<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Reline::LineEditor - reline: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-add_dialog_proc">#add_dialog_proc</a>
    <li ><a href="#method-i-argumentable-3F">#argumentable?</a>
    <li ><a href="#method-i-backward_char">#backward_char</a>
    <li ><a href="#method-i-backward_delete_char">#backward_delete_char</a>
    <li ><a href="#method-i-backward_kill_word">#backward_kill_word</a>
    <li ><a href="#method-i-backward_word">#backward_word</a>
    <li ><a href="#method-i-beginning_of_line">#beginning_of_line</a>
    <li ><a href="#method-i-byte_pointer-3D">#byte_pointer=</a>
    <li ><a href="#method-i-byteinsert">#byteinsert</a>
    <li ><a href="#method-i-byteslice-21">#byteslice!</a>
    <li ><a href="#method-i-calculate_height_by_lines">#calculate_height_by_lines</a>
    <li ><a href="#method-i-calculate_height_by_width">#calculate_height_by_width</a>
    <li ><a href="#method-i-calculate_nearest_cursor">#calculate_nearest_cursor</a>
    <li ><a href="#method-i-calculate_scroll_partial_screen">#calculate_scroll_partial_screen</a>
    <li ><a href="#method-i-calculate_width">#calculate_width</a>
    <li ><a href="#method-i-call_completion_proc">#call_completion_proc</a>
    <li ><a href="#method-i-call_completion_proc_with_checking_args">#call_completion_proc_with_checking_args</a>
    <li ><a href="#method-i-capitalize_word">#capitalize_word</a>
    <li ><a href="#method-i-check_mode_string">#check_mode_string</a>
    <li ><a href="#method-i-check_multiline_prompt">#check_multiline_prompt</a>
    <li ><a href="#method-i-clear_dialog">#clear_dialog</a>
    <li ><a href="#method-i-clear_dialog_with_trap_key">#clear_dialog_with_trap_key</a>
    <li ><a href="#method-i-clear_screen">#clear_screen</a>
    <li ><a href="#method-i-clear_screen_buffer">#clear_screen_buffer</a>
    <li ><a href="#method-i-complete">#complete</a>
    <li ><a href="#method-i-complete_internal_proc">#complete_internal_proc</a>
    <li ><a href="#method-i-confirm_multiline_termination">#confirm_multiline_termination</a>
    <li ><a href="#method-i-copy_for_vi">#copy_for_vi</a>
    <li ><a href="#method-i-delete_char">#delete_char</a>
    <li ><a href="#method-i-delete_char_or_list">#delete_char_or_list</a>
    <li ><a href="#method-i-delete_text">#delete_text</a>
    <li ><a href="#method-i-dialog_range">#dialog_range</a>
    <li ><a href="#method-i-downcase_word">#downcase_word</a>
    <li ><a href="#method-i-ed_argument_digit">#ed_argument_digit</a>
    <li ><a href="#method-i-ed_clear_screen">#ed_clear_screen</a>
    <li ><a href="#method-i-ed_delete_next_char">#ed_delete_next_char</a>
    <li ><a href="#method-i-ed_delete_prev_char">#ed_delete_prev_char</a>
    <li ><a href="#method-i-ed_delete_prev_word">#ed_delete_prev_word</a>
    <li ><a href="#method-i-ed_digit">#ed_digit</a>
    <li ><a href="#method-i-ed_insert">#ed_insert</a>
    <li ><a href="#method-i-ed_kill_line">#ed_kill_line</a>
    <li ><a href="#method-i-ed_move_to_beg">#ed_move_to_beg</a>
    <li ><a href="#method-i-ed_move_to_end">#ed_move_to_end</a>
    <li ><a href="#method-i-ed_newline">#ed_newline</a>
    <li ><a href="#method-i-ed_next_char">#ed_next_char</a>
    <li ><a href="#method-i-ed_next_history">#ed_next_history</a>
    <li ><a href="#method-i-ed_prev_char">#ed_prev_char</a>
    <li ><a href="#method-i-ed_prev_history">#ed_prev_history</a>
    <li ><a href="#method-i-ed_prev_word">#ed_prev_word</a>
    <li ><a href="#method-i-ed_quoted_insert">#ed_quoted_insert</a>
    <li ><a href="#method-i-ed_search_next_history">#ed_search_next_history</a>
    <li ><a href="#method-i-ed_search_prev_history">#ed_search_prev_history</a>
    <li ><a href="#method-i-ed_transpose_chars">#ed_transpose_chars</a>
    <li ><a href="#method-i-ed_transpose_words">#ed_transpose_words</a>
    <li ><a href="#method-i-ed_unassigned">#ed_unassigned</a>
    <li ><a href="#method-i-editing_mode">#editing_mode</a>
    <li ><a href="#method-i-em_capitol_case">#em_capitol_case</a>
    <li ><a href="#method-i-em_delete">#em_delete</a>
    <li ><a href="#method-i-em_delete_next_word">#em_delete_next_word</a>
    <li ><a href="#method-i-em_delete_or_list">#em_delete_or_list</a>
    <li ><a href="#method-i-em_delete_prev_char">#em_delete_prev_char</a>
    <li ><a href="#method-i-em_exchange_mark">#em_exchange_mark</a>
    <li ><a href="#method-i-em_kill_line">#em_kill_line</a>
    <li ><a href="#method-i-em_kill_region">#em_kill_region</a>
    <li ><a href="#method-i-em_lower_case">#em_lower_case</a>
    <li ><a href="#method-i-em_meta_next">#em_meta_next</a>
    <li ><a href="#method-i-em_next_word">#em_next_word</a>
    <li ><a href="#method-i-em_set_mark">#em_set_mark</a>
    <li ><a href="#method-i-em_upper_case">#em_upper_case</a>
    <li ><a href="#method-i-em_yank">#em_yank</a>
    <li ><a href="#method-i-em_yank_pop">#em_yank_pop</a>
    <li ><a href="#method-i-end_of_line">#end_of_line</a>
    <li ><a href="#method-i-eof-3F">#eof?</a>
    <li ><a href="#method-i-exchange_point_and_mark">#exchange_point_and_mark</a>
    <li ><a href="#method-i-finalize">#finalize</a>
    <li ><a href="#method-i-finish">#finish</a>
    <li ><a href="#method-i-finished-3F">#finished?</a>
    <li ><a href="#method-i-forward_char">#forward_char</a>
    <li ><a href="#method-i-forward_search_history">#forward_search_history</a>
    <li ><a href="#method-i-forward_word">#forward_word</a>
    <li ><a href="#method-i-generate_searcher">#generate_searcher</a>
    <li ><a href="#method-i-history_search_backward">#history_search_backward</a>
    <li ><a href="#method-i-history_search_forward">#history_search_forward</a>
    <li ><a href="#method-i-inclusive-3F">#inclusive?</a>
    <li ><a href="#method-i-incremental_search_history">#incremental_search_history</a>
    <li ><a href="#method-i-input_key">#input_key</a>
    <li ><a href="#method-i-insert_new_line">#insert_new_line</a>
    <li ><a href="#method-i-insert_text">#insert_text</a>
    <li ><a href="#method-i-io_gate">#io_gate</a>
    <li ><a href="#method-i-just_move_cursor">#just_move_cursor</a>
    <li ><a href="#method-i-key_delete">#key_delete</a>
    <li ><a href="#method-i-key_newline">#key_newline</a>
    <li ><a href="#method-i-kill_line">#kill_line</a>
    <li ><a href="#method-i-kill_whole_line">#kill_whole_line</a>
    <li ><a href="#method-i-kill_word">#kill_word</a>
    <li ><a href="#method-i-menu">#menu</a>
    <li ><a href="#method-i-modify_lines">#modify_lines</a>
    <li ><a href="#method-i-move_completed_list">#move_completed_list</a>
    <li ><a href="#method-i-move_cursor_down">#move_cursor_down</a>
    <li ><a href="#method-i-move_cursor_up">#move_cursor_up</a>
    <li ><a href="#method-i-multiline_off">#multiline_off</a>
    <li ><a href="#method-i-multiline_on">#multiline_on</a>
    <li ><a href="#method-i-next_history">#next_history</a>
    <li ><a href="#method-i-normal_char">#normal_char</a>
    <li ><a href="#method-i-padding_space_with_escape_sequences">#padding_space_with_escape_sequences</a>
    <li ><a href="#method-i-previous_history">#previous_history</a>
    <li ><a href="#method-i-process_auto_indent">#process_auto_indent</a>
    <li ><a href="#method-i-process_insert">#process_insert</a>
    <li ><a href="#method-i-process_key">#process_key</a>
    <li ><a href="#method-i-quoted_insert">#quoted_insert</a>
    <li ><a href="#method-i-range_subtract">#range_subtract</a>
    <li ><a href="#method-i-render_dialog">#render_dialog</a>
    <li ><a href="#method-i-render_dialog_changes">#render_dialog_changes</a>
    <li ><a href="#method-i-render_partial">#render_partial</a>
    <li ><a href="#method-i-render_whole_lines">#render_whole_lines</a>
    <li ><a href="#method-i-rerender">#rerender</a>
    <li ><a href="#method-i-rerender_added_newline">#rerender_added_newline</a>
    <li ><a href="#method-i-rerender_all">#rerender_all</a>
    <li ><a href="#method-i-rerender_all_lines">#rerender_all_lines</a>
    <li ><a href="#method-i-rerender_changed_current_line">#rerender_changed_current_line</a>
    <li ><a href="#method-i-reset">#reset</a>
    <li ><a href="#method-i-reset_line">#reset_line</a>
    <li ><a href="#method-i-reset_variables">#reset_variables</a>
    <li ><a href="#method-i-resize">#resize</a>
    <li ><a href="#method-i-retrieve_completion_block">#retrieve_completion_block</a>
    <li ><a href="#method-i-reverse_search_history">#reverse_search_history</a>
    <li ><a href="#method-i-run_for_operators">#run_for_operators</a>
    <li ><a href="#method-i-scroll_down">#scroll_down</a>
    <li ><a href="#method-i-search_next_char">#search_next_char</a>
    <li ><a href="#method-i-search_prev_char">#search_prev_char</a>
    <li ><a href="#method-i-self_insert">#self_insert</a>
    <li ><a href="#method-i-set_mark">#set_mark</a>
    <li ><a href="#method-i-set_pasting_state">#set_pasting_state</a>
    <li ><a href="#method-i-set_signal_handlers">#set_signal_handlers</a>
    <li ><a href="#method-i-show_menu">#show_menu</a>
    <li ><a href="#method-i-simplified_rendering-3F">#simplified_rendering?</a>
    <li ><a href="#method-i-split_by_width">#split_by_width</a>
    <li ><a href="#method-i-transpose_chars">#transpose_chars</a>
    <li ><a href="#method-i-transpose_words">#transpose_words</a>
    <li ><a href="#method-i-unix_line_discard">#unix_line_discard</a>
    <li ><a href="#method-i-unix_word_rubout">#unix_word_rubout</a>
    <li ><a href="#method-i-upcase_word">#upcase_word</a>
    <li ><a href="#method-i-update_each_dialog">#update_each_dialog</a>
    <li ><a href="#method-i-vi_add">#vi_add</a>
    <li ><a href="#method-i-vi_add_at_eol">#vi_add_at_eol</a>
    <li ><a href="#method-i-vi_change_meta">#vi_change_meta</a>
    <li ><a href="#method-i-vi_command_mode">#vi_command_mode</a>
    <li ><a href="#method-i-vi_delete_meta">#vi_delete_meta</a>
    <li ><a href="#method-i-vi_delete_prev_char">#vi_delete_prev_char</a>
    <li ><a href="#method-i-vi_end_big_word">#vi_end_big_word</a>
    <li ><a href="#method-i-vi_end_of_transmission">#vi_end_of_transmission</a>
    <li ><a href="#method-i-vi_end_word">#vi_end_word</a>
    <li ><a href="#method-i-vi_eof_maybe">#vi_eof_maybe</a>
    <li ><a href="#method-i-vi_first_print">#vi_first_print</a>
    <li ><a href="#method-i-vi_histedit">#vi_histedit</a>
    <li ><a href="#method-i-vi_insert">#vi_insert</a>
    <li ><a href="#method-i-vi_insert_at_bol">#vi_insert_at_bol</a>
    <li ><a href="#method-i-vi_join_lines">#vi_join_lines</a>
    <li ><a href="#method-i-vi_kill_line_prev">#vi_kill_line_prev</a>
    <li ><a href="#method-i-vi_list_or_eof">#vi_list_or_eof</a>
    <li ><a href="#method-i-vi_movement_mode">#vi_movement_mode</a>
    <li ><a href="#method-i-vi_next_big_word">#vi_next_big_word</a>
    <li ><a href="#method-i-vi_next_char">#vi_next_char</a>
    <li ><a href="#method-i-vi_next_word">#vi_next_word</a>
    <li ><a href="#method-i-vi_paste_next">#vi_paste_next</a>
    <li ><a href="#method-i-vi_paste_prev">#vi_paste_prev</a>
    <li ><a href="#method-i-vi_prev_big_word">#vi_prev_big_word</a>
    <li ><a href="#method-i-vi_prev_char">#vi_prev_char</a>
    <li ><a href="#method-i-vi_prev_word">#vi_prev_word</a>
    <li ><a href="#method-i-vi_replace_char">#vi_replace_char</a>
    <li ><a href="#method-i-vi_search_next">#vi_search_next</a>
    <li ><a href="#method-i-vi_search_prev">#vi_search_prev</a>
    <li ><a href="#method-i-vi_to_column">#vi_to_column</a>
    <li ><a href="#method-i-vi_to_history_line">#vi_to_history_line</a>
    <li ><a href="#method-i-vi_to_next_char">#vi_to_next_char</a>
    <li ><a href="#method-i-vi_to_prev_char">#vi_to_prev_char</a>
    <li ><a href="#method-i-vi_yank">#vi_yank</a>
    <li ><a href="#method-i-vi_zero">#vi_zero</a>
    <li ><a href="#method-i-whole_buffer">#whole_buffer</a>
    <li ><a href="#method-i-whole_lines">#whole_lines</a>
    <li ><a href="#method-i-wrap_method_call">#wrap_method_call</a>
    <li ><a href="#method-i-yank">#yank</a>
    <li ><a href="#method-i-yank_pop">#yank_pop</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Reline::LineEditor">
    <h1 id="class-Reline::LineEditor" class="class">
      class Reline::LineEditor
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="CompletionJourneyData">CompletionJourneyData
          <dd>
          <dt id="DIALOG_DEFAULT_HEIGHT">DIALOG_DEFAULT_HEIGHT
          <dd>
          <dt id="MINIMUM_SCROLLBAR_HEIGHT">MINIMUM_SCROLLBAR_HEIGHT
          <dd>
          <dt id="MenuInfo">MenuInfo
          <dd>
          <dt id="PROMPT_LIST_CACHE_TIMEOUT">PROMPT_LIST_CACHE_TIMEOUT
          <dd>
          <dt id="VI_MOTIONS">VI_MOTIONS
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-auto_indent_proc" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">auto_indent_proc</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-byte_pointer" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">byte_pointer</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-completion_append_character" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">completion_append_character</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-completion_proc" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">completion_proc</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-confirm_multiline_termination_proc" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">confirm_multiline_termination_proc</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-dig_perfect_match_proc" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">dig_perfect_match_proc</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-line" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">line</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>TODO: undo TODO: Use “private alias_method” idiom after drop Ruby 2.5.</p>
              </div>
            </div>
          <div id="attribute-i-output" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">output</span><span
                class="attribute-access-type">[W]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-output_modifier_proc" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">output_modifier_proc</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-pre_input_hook" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">pre_input_hook</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-prompt_proc" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">prompt_proc</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(config, encoding)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 57</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">encoding</span>)
  <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">config</span>
  <span class="ruby-ivar">@completion_append_character</span> = <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-identifier">reset_variables</span>(<span class="ruby-value">encoding:</span> <span class="ruby-identifier">encoding</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-add_dialog_proc" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_dialog_proc</span><span
                                class="method-args">(name, p, context = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_dialog_proc-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 639</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_dialog_proc</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">p</span>, <span class="ruby-identifier">context</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">dialog</span> = <span class="ruby-constant">Dialog</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-ivar">@config</span>, <span class="ruby-constant">DialogProcScope</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-ivar">@config</span>, <span class="ruby-identifier">p</span>, <span class="ruby-identifier">context</span>))
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">index</span> = <span class="ruby-ivar">@dialogs</span>.<span class="ruby-identifier">find_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span> }
    <span class="ruby-ivar">@dialogs</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-identifier">dialog</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@dialogs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">dialog</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-backward_char" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">backward_char</span><span
                                class="method-args">(key, arg: 1)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_prev_char">ed_prev_char</a>
                            </div>
                          </div>

                  <div id="method-i-backward_delete_char" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">backward_delete_char</span><span
                                class="method-args">(key, arg: 1)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_delete_prev_char">em_delete_prev_char</a>
                            </div>
                          </div>

                  <div id="method-i-backward_kill_word" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">backward_kill_word</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_delete_prev_word">ed_delete_prev_word</a>
                            </div>
                          </div>

                  <div id="method-i-backward_word" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">backward_word</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_prev_word">ed_prev_word</a>
                            </div>
                          </div>

                  <div id="method-i-beginning_of_line" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">beginning_of_line</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_move_to_beg">ed_move_to_beg</a>
                            </div>
                          </div>

                  <div id="method-i-byte_pointer-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">byte_pointer=</span><span
                                class="method-args">(val)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="byte_pointer-3D-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1842</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">byte_pointer=</span>(<span class="ruby-identifier">val</span>)
  <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">val</span>
  <span class="ruby-identifier">str</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">str</span>)
  <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-call_completion_proc" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">call_completion_proc</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="call_completion_proc-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1613</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">call_completion_proc</span>
  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">retrieve_completion_block</span>(<span class="ruby-keyword">true</span>)
  <span class="ruby-identifier">pre</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">post</span> = <span class="ruby-identifier">result</span>
  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">call_completion_proc_with_checking_args</span>(<span class="ruby-identifier">pre</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">post</span>)
  <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">core</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value">:@completion_quote_character</span>, <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">result</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-call_completion_proc_with_checking_args" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">call_completion_proc_with_checking_args</span><span
                                class="method-args">(pre, target, post)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="call_completion_proc_with_checking_args-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1621</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">call_completion_proc_with_checking_args</span>(<span class="ruby-identifier">pre</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">post</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@completion_proc</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">target</span>
    <span class="ruby-identifier">argnum</span> = <span class="ruby-ivar">@completion_proc</span>.<span class="ruby-identifier">parameters</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, <span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">first</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:req</span>, <span class="ruby-value">:opt</span>
        <span class="ruby-identifier">result</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:rest</span>
        <span class="ruby-keyword">break</span> <span class="ruby-value">3</span>
      <span class="ruby-keyword">end</span>
    }
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">argnum</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@completion_proc</span>.(<span class="ruby-identifier">target</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-value">2</span>
      <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@completion_proc</span>.(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">pre</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-value">3</span><span class="ruby-operator">..</span><span class="ruby-constant">Float</span><span class="ruby-operator">::</span><span class="ruby-constant">INFINITY</span>
      <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@completion_proc</span>.(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">pre</span>, <span class="ruby-identifier">post</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">result</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-capitalize_word" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">capitalize_word</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_capitol_case">em_capitol_case</a>
                            </div>
                          </div>

                  <div id="method-i-clear_screen" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">clear_screen</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_clear_screen">ed_clear_screen</a>
                            </div>
                          </div>

                  <div id="method-i-confirm_multiline_termination" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">confirm_multiline_termination</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="confirm_multiline_termination-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1760</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">confirm_multiline_termination</span>
  <span class="ruby-identifier">temp_buffer</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@previous_line_index</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">==</span> (<span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-identifier">temp_buffer</span>[<span class="ruby-ivar">@previous_line_index</span>] = <span class="ruby-ivar">@line</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">temp_buffer</span>[<span class="ruby-ivar">@line_index</span>] = <span class="ruby-ivar">@line</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@confirm_multiline_termination_proc</span>.(<span class="ruby-identifier">temp_buffer</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-delete_char" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">delete_char</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_delete">em_delete</a>
                            </div>
                          </div>

                  <div id="method-i-delete_char_or_list" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">delete_char_or_list</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_delete_or_list">em_delete_or_list</a>
                            </div>
                          </div>

                  <div id="method-i-delete_text" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">delete_text</span><span
                                class="method-args">(start = nil, length = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="delete_text-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1782</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_text</span>(<span class="ruby-identifier">start</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">length</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">start</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">length</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
        <span class="ruby-ivar">@line</span>&amp;.<span class="ruby-identifier">clear</span>
        <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-value">0</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">==</span> (<span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
        <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">pop</span>
        <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
        <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
        <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
      <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&lt;</span> (<span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
        <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-ivar">@line_index</span>)
        <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
        <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@line</span>&amp;.<span class="ruby-identifier">clear</span>
      <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
      <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-value">0</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">start</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">length</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>
      <span class="ruby-identifier">before</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">start</span>)
      <span class="ruby-identifier">after</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">start</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">length</span>, <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>)
      <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">before</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">after</span>
      <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
      <span class="ruby-identifier">str</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
      <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">str</span>)
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">start</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Range</span>)
    <span class="ruby-identifier">range</span> = <span class="ruby-identifier">start</span>
    <span class="ruby-identifier">first</span> = <span class="ruby-identifier">range</span>.<span class="ruby-identifier">first</span>
    <span class="ruby-identifier">last</span> = <span class="ruby-identifier">range</span>.<span class="ruby-identifier">last</span>
    <span class="ruby-identifier">last</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">last</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-identifier">last</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">last</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">first</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">first</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">range</span> = <span class="ruby-identifier">range</span>.<span class="ruby-identifier">exclude_end?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">first</span><span class="ruby-operator">...</span><span class="ruby-identifier">last</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">first</span><span class="ruby-operator">..</span><span class="ruby-identifier">last</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">reject</span>.<span class="ruby-identifier">with_index</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">c</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">i</span>) }.<span class="ruby-identifier">map</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">chr</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">ASCII_8BIT</span>) }.<span class="ruby-identifier">join</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-ivar">@encoding</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-identifier">str</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">str</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">start</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-identifier">str</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">str</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-downcase_word" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">downcase_word</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_lower_case">em_lower_case</a>
                            </div>
                          </div>

                  <div id="method-i-ed_digit" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">ed_digit</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_insert">ed_insert</a>
                            </div>
                          </div>

                  <div id="method-i-editing_mode" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">editing_mode</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="editing_mode-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1229</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">editing_mode</span>
  <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-end_of_line" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">end_of_line</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_move_to_end">ed_move_to_end</a>
                            </div>
                          </div>

                  <div id="method-i-eof-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">eof?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="eof-3F-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 252</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">eof?</span>
  <span class="ruby-ivar">@eof</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-exchange_point_and_mark" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">exchange_point_and_mark</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_exchange_mark">em_exchange_mark</a>
                            </div>
                          </div>

                  <div id="method-i-finalize" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">finalize</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="finalize-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 248</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">finalize</span>
  <span class="ruby-constant">Signal</span>.<span class="ruby-identifier">trap</span>(<span class="ruby-string">&#39;INT&#39;</span>, <span class="ruby-ivar">@old_trap</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-finish" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">finish</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="finish-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1868</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">finish</span>
  <span class="ruby-ivar">@finished</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">reset</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-finished-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">finished?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="finished-3F-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1864</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">finished?</span>
  <span class="ruby-ivar">@finished</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-forward_char" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">forward_char</span><span
                                class="method-args">(key, arg: 1)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_next_char">ed_next_char</a>
                            </div>
                          </div>

                  <div id="method-i-forward_search_history" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">forward_search_history</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-vi_search_next">vi_search_next</a>
                            </div>
                          </div>

                  <div id="method-i-forward_word" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">forward_word</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_next_word">em_next_word</a>
                            </div>
                          </div>

                  <div id="method-i-history_search_backward" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">history_search_backward</span><span
                                class="method-args">(key, arg: 1)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_search_prev_history">ed_search_prev_history</a>
                            </div>
                          </div>

                  <div id="method-i-history_search_forward" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">history_search_forward</span><span
                                class="method-args">(key, arg: 1)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_search_next_history">ed_search_next_history</a>
                            </div>
                          </div>

                  <div id="method-i-input_key" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">input_key</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="input_key-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1538</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">input_key</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@last_key</span> = <span class="ruby-identifier">key</span>
  <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">reset_oneshot_key_bindings</span>
  <span class="ruby-ivar">@dialogs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dialog</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">Symbol</span>) <span class="ruby-keyword">and</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">name</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@just_cursor_moving</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@first_char</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">finish</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">old_line</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@first_char</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-identifier">completion_occurs</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>, <span class="ruby-value">:vi_insert</span>) <span class="ruby-keyword">and</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\C-i&quot;</span>.<span class="ruby-identifier">ord</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">disable_completion</span>
      <span class="ruby-identifier">result</span> = <span class="ruby-identifier">call_completion_proc</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
        <span class="ruby-identifier">completion_occurs</span> = <span class="ruby-keyword">true</span>
        <span class="ruby-identifier">process_insert</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">autocompletion</span>
          <span class="ruby-identifier">move_completed_list</span>(<span class="ruby-identifier">result</span>, <span class="ruby-value">:down</span>)
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">complete</span>(<span class="ruby-identifier">result</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>, <span class="ruby-value">:vi_insert</span>) <span class="ruby-keyword">and</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-value">:completion_journey_up</span>
    <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">disable_completion</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">autocompletion</span>
      <span class="ruby-identifier">result</span> = <span class="ruby-identifier">call_completion_proc</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
        <span class="ruby-identifier">completion_occurs</span> = <span class="ruby-keyword">true</span>
        <span class="ruby-identifier">process_insert</span>
        <span class="ruby-identifier">move_completed_list</span>(<span class="ruby-identifier">result</span>, <span class="ruby-value">:up</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">disable_completion</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_insert</span>) <span class="ruby-keyword">and</span> [<span class="ruby-string">&quot;\C-p&quot;</span>.<span class="ruby-identifier">ord</span>, <span class="ruby-string">&quot;\C-n&quot;</span>.<span class="ruby-identifier">ord</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span>)
    <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">disable_completion</span>
      <span class="ruby-identifier">result</span> = <span class="ruby-identifier">call_completion_proc</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
        <span class="ruby-identifier">completion_occurs</span> = <span class="ruby-keyword">true</span>
        <span class="ruby-identifier">process_insert</span>
        <span class="ruby-identifier">move_completed_list</span>(<span class="ruby-identifier">result</span>, <span class="ruby-string">&quot;\C-p&quot;</span>.<span class="ruby-identifier">ord</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span> <span class="ruby-operator">?</span> <span class="ruby-value">:up</span> <span class="ruby-operator">:</span> <span class="ruby-value">:down</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-constant">Symbol</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-identifier">process_key</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span>, <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">normal_char</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">completion_occurs</span>
    <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">NORMAL</span>
    <span class="ruby-ivar">@completion_journey_data</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@in_pasting</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@just_cursor_moving</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@previous_line_index</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@previous_line_index</span>] <span class="ruby-operator">==</span> <span class="ruby-ivar">@line</span>
      <span class="ruby-ivar">@just_cursor_moving</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@previous_line_index</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>] <span class="ruby-operator">==</span> <span class="ruby-ivar">@line</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">old_line</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@line</span>
      <span class="ruby-ivar">@just_cursor_moving</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@just_cursor_moving</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@just_cursor_moving</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@auto_indent_proc</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">simplified_rendering?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line</span>
    <span class="ruby-identifier">process_auto_indent</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-insert_text" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">insert_text</span><span
                                class="method-args">(text)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="insert_text-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1770</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_text</span>(<span class="ruby-identifier">text</span>)
  <span class="ruby-identifier">width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">text</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@cursor_max</span>
    <span class="ruby-ivar">@line</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">text</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">byteinsert</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">text</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-io_gate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">io_gate</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="io_gate-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 63</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">io_gate</span>
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-just_move_cursor" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">just_move_cursor</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="just_move_cursor-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 935</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">just_move_cursor</span>
  <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-ivar">@buffer_of_lines</span>)
  <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@started_from</span>)
  <span class="ruby-identifier">new_first_line_started_from</span> =
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line_index</span>.<span class="ruby-identifier">zero?</span>
      <span class="ruby-value">0</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">calculate_height_by_lines</span>(<span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)], <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prompt</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">first_line_diff</span> = <span class="ruby-identifier">new_first_line_started_from</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@first_line_started_from</span>
  <span class="ruby-ivar">@cursor</span>, <span class="ruby-ivar">@cursor_max</span>, <span class="ruby-identifier">_</span>, <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">calculate_nearest_cursor</span>(<span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>], <span class="ruby-ivar">@cursor</span>, <span class="ruby-ivar">@started_from</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">new_started_from</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">calculate_scroll_partial_screen</span>(<span class="ruby-ivar">@highest_in_all</span>, <span class="ruby-identifier">new_first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">new_started_from</span>)
  <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@rerender_all</span>
    <span class="ruby-identifier">rerender_all_lines</span>
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@first_line_started_from</span> = <span class="ruby-identifier">new_first_line_started_from</span>
    <span class="ruby-ivar">@started_from</span> = <span class="ruby-identifier">new_started_from</span>
    <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-identifier">first_line_diff</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span>)
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>((<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">%</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-kill_line" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">kill_line</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_kill_line">ed_kill_line</a>
                            </div>
                          </div>

                  <div id="method-i-kill_whole_line" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">kill_whole_line</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_kill_line">em_kill_line</a>
                            </div>
                          </div>

                  <div id="method-i-kill_word" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">kill_word</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_delete_next_word">em_delete_next_word</a>
                            </div>
                          </div>

                  <div id="method-i-multiline_off" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">multiline_off</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="multiline_off-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 318</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">multiline_off</span>
  <span class="ruby-ivar">@is_multiline</span> = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-multiline_on" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">multiline_on</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="multiline_on-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 314</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">multiline_on</span>
  <span class="ruby-ivar">@is_multiline</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-next_history" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">next_history</span><span
                                class="method-args">(key, arg: 1)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_next_history">ed_next_history</a>
                            </div>
                          </div>

                  <div id="method-i-previous_history" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">previous_history</span><span
                                class="method-args">(key, arg: 1)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_prev_history">ed_prev_history</a>
                            </div>
                          </div>

                  <div id="method-i-quoted_insert" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">quoted_insert</span><span
                                class="method-args">(str, arg: 1)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_quoted_insert">ed_quoted_insert</a>
                            </div>
                          </div>

                  <div id="method-i-rerender" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rerender</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rerender-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 426</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rerender</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@menu_info</span>
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@first_line_started_from</span>)
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@menu_info</span>
    <span class="ruby-identifier">show_menu</span>
    <span class="ruby-ivar">@menu_info</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-identifier">whole_lines</span>)
  <span class="ruby-identifier">cursor_column</span> = (<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">%</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cleared</span>
    <span class="ruby-identifier">clear_screen_buffer</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_list</span>, <span class="ruby-identifier">prompt_width</span>)
    <span class="ruby-ivar">@cleared</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">finished?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@scroll_partial_screen</span>
    <span class="ruby-comment"># Re-output all code higher than the screen when finished.</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scroll_partial_screen</span>)
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
    <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">new_lines</span> = <span class="ruby-identifier">whole_lines</span>
    <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-identifier">new_lines</span>)
    <span class="ruby-identifier">modify_lines</span>(<span class="ruby-identifier">new_lines</span>).<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
      <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">&quot;#{prompt_list ? prompt_list[index] : prompt}#{line}\r\n&quot;</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">flush</span>
    <span class="ruby-identifier">clear_dialog</span>(<span class="ruby-identifier">cursor_column</span>)
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">new_highest_in_this</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-string">&#39;&#39;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@line</span>))
  <span class="ruby-identifier">rendered</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@add_newline_to_end_of_buffer</span>
    <span class="ruby-identifier">clear_dialog_with_trap_key</span>(<span class="ruby-identifier">cursor_column</span>)
    <span class="ruby-identifier">rerender_added_newline</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span>)
    <span class="ruby-ivar">@add_newline_to_end_of_buffer</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@just_cursor_moving</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@rerender_all</span>
      <span class="ruby-identifier">clear_dialog_with_trap_key</span>(<span class="ruby-identifier">cursor_column</span>)
      <span class="ruby-identifier">rendered</span> = <span class="ruby-identifier">just_move_cursor</span>
      <span class="ruby-ivar">@just_cursor_moving</span> = <span class="ruby-keyword">false</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@previous_line_index</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">new_highest_in_this</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@highest_in_this</span>
      <span class="ruby-identifier">clear_dialog_with_trap_key</span>(<span class="ruby-identifier">cursor_column</span>)
      <span class="ruby-identifier">rerender_changed_current_line</span>
      <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">rendered</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@rerender_all</span>
      <span class="ruby-identifier">rerender_all_lines</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">false</span>
      <span class="ruby-identifier">rendered</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">finished?</span>
      <span class="ruby-comment"># Always rerender on finish because output_modifier_proc may return a different output.</span>
      <span class="ruby-identifier">new_lines</span> = <span class="ruby-identifier">whole_lines</span>
      <span class="ruby-identifier">line</span> = <span class="ruby-identifier">modify_lines</span>(<span class="ruby-identifier">new_lines</span>)[<span class="ruby-ivar">@line_index</span>]
      <span class="ruby-identifier">clear_dialog</span>(<span class="ruby-identifier">cursor_column</span>)
      <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-identifier">new_lines</span>)
      <span class="ruby-identifier">render_partial</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">line</span>, <span class="ruby-ivar">@first_line_started_from</span>)
      <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> (<span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@highest_in_this</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
      <span class="ruby-identifier">scroll_down</span>(<span class="ruby-value">1</span>)
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">rendered</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@in_pasting</span>
        <span class="ruby-identifier">line</span> = <span class="ruby-identifier">modify_lines</span>(<span class="ruby-identifier">whole_lines</span>)[<span class="ruby-ivar">@line_index</span>]
        <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-identifier">whole_lines</span>)
        <span class="ruby-identifier">render_partial</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">line</span>, <span class="ruby-ivar">@first_line_started_from</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">render_dialog</span>(<span class="ruby-identifier">cursor_column</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>] = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@rest_height</span> = <span class="ruby-value">0</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">line</span> = <span class="ruby-identifier">modify_lines</span>(<span class="ruby-identifier">whole_lines</span>)[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-identifier">render_partial</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">line</span>, <span class="ruby-value">0</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">finished?</span>
      <span class="ruby-identifier">scroll_down</span>(<span class="ruby-value">1</span>)
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-rerender_all" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rerender_all</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rerender_all-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 420</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rerender_all</span>
  <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-identifier">process_insert</span>(<span class="ruby-value">force:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-identifier">rerender</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset</span><span
                                class="method-args">(prompt = &#39;&#39;, encoding:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 154</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset</span>(<span class="ruby-identifier">prompt</span> = <span class="ruby-string">&#39;&#39;</span>, <span class="ruby-value">encoding:</span>)
  <span class="ruby-ivar">@rest_height</span> = (<span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">get_screen_size</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">-</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">cursor_pos</span>.<span class="ruby-identifier">y</span>
  <span class="ruby-ivar">@screen_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">get_screen_size</span>
  <span class="ruby-ivar">@screen_height</span> = <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">first</span>
  <span class="ruby-identifier">reset_variables</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-value">encoding:</span> <span class="ruby-identifier">encoding</span>)
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">set_winch_handler</span> <span class="ruby-keyword">do</span>
    <span class="ruby-ivar">@resized</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">&#39;RELINE_ALT_SCROLLBAR&#39;</span>)
    <span class="ruby-ivar">@full_block</span> = <span class="ruby-string">&#39;::&#39;</span>
    <span class="ruby-ivar">@upper_half_block</span> = <span class="ruby-string">&quot;&#39;&#39;&quot;</span>
    <span class="ruby-ivar">@lower_half_block</span> = <span class="ruby-string">&#39;..&#39;</span>
    <span class="ruby-ivar">@block_elem_width</span> = <span class="ruby-value">2</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">win?</span>
    <span class="ruby-ivar">@full_block</span> = <span class="ruby-string">&#39;█&#39;</span>
    <span class="ruby-ivar">@upper_half_block</span> = <span class="ruby-string">&#39;▀&#39;</span>
    <span class="ruby-ivar">@lower_half_block</span> = <span class="ruby-string">&#39;▄&#39;</span>
    <span class="ruby-ivar">@block_elem_width</span> = <span class="ruby-value">1</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@encoding</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>
    <span class="ruby-ivar">@full_block</span> = <span class="ruby-string">&#39;█&#39;</span>
    <span class="ruby-ivar">@upper_half_block</span> = <span class="ruby-string">&#39;▀&#39;</span>
    <span class="ruby-ivar">@lower_half_block</span> = <span class="ruby-string">&#39;▄&#39;</span>
    <span class="ruby-ivar">@block_elem_width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">calculate_width</span>(<span class="ruby-string">&#39;█&#39;</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@full_block</span> = <span class="ruby-string">&#39;::&#39;</span>
    <span class="ruby-ivar">@upper_half_block</span> = <span class="ruby-string">&quot;&#39;&#39;&quot;</span>
    <span class="ruby-ivar">@lower_half_block</span> = <span class="ruby-string">&#39;..&#39;</span>
    <span class="ruby-ivar">@block_elem_width</span> = <span class="ruby-value">2</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset_line" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset_line</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset_line-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 296</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset_line</span>
  <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)]
  <span class="ruby-ivar">@line_index</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-value">0</span>]
  <span class="ruby-ivar">@first_line_started_from</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@move_up</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@started_from</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@highest_in_this</span> = <span class="ruby-value">1</span>
  <span class="ruby-ivar">@highest_in_all</span> = <span class="ruby-value">1</span>
  <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@multibyte_buffer</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-string">&#39;ASCII-8BIT&#39;</span>)
  <span class="ruby-ivar">@check_new_auto_indent</span> = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset_variables" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset_variables</span><span
                                class="method-args">(prompt = &#39;&#39;, encoding:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset_variables-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 256</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset_variables</span>(<span class="ruby-identifier">prompt</span> = <span class="ruby-string">&#39;&#39;</span>, <span class="ruby-value">encoding:</span>)
  <span class="ruby-ivar">@prompt</span> = <span class="ruby-identifier">prompt</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">&quot;\n&quot;</span>, <span class="ruby-string">&quot;\\n&quot;</span>)
  <span class="ruby-ivar">@mark_pointer</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@encoding</span> = <span class="ruby-identifier">encoding</span>
  <span class="ruby-ivar">@is_multiline</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@finished</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@cleared</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@kill_ring</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">KillRing</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@vi_clipboard</span> = <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-ivar">@vi_arg</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@waiting_operator_proc</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@waiting_operator_vi_arg</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@completion_journey_data</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">NORMAL</span>
  <span class="ruby-ivar">@perfect_matched</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@menu_info</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@first_prompt</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@first_char</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@add_newline_to_end_of_buffer</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@just_cursor_moving</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@cached_prompt_list</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@prompt_cache_time</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@eof</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@continuous_insertion_buffer</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)
  <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@prev_mode_string</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@drop_terminate_spaces</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@in_pasting</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@auto_indent_proc</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@dialogs</span> = []
  <span class="ruby-ivar">@previous_rendered_dialog_y</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@last_key</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@resized</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-identifier">reset_line</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resize" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resize</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resize-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 185</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resize</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@resized</span>
  <span class="ruby-ivar">@resized</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@rest_height</span> = (<span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">get_screen_size</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">-</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">cursor_pos</span>.<span class="ruby-identifier">y</span>
  <span class="ruby-identifier">old_screen_size</span> = <span class="ruby-ivar">@screen_size</span>
  <span class="ruby-ivar">@screen_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">get_screen_size</span>
  <span class="ruby-ivar">@screen_height</span> = <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">first</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">old_screen_size</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span> <span class="ruby-comment"># columns increase</span>
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-identifier">rerender</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">back</span> = <span class="ruby-value">0</span>
    <span class="ruby-identifier">new_buffer</span> = <span class="ruby-identifier">whole_lines</span>
    <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-identifier">new_buffer</span>)
    <span class="ruby-identifier">new_buffer</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">prompt_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt_list</span>[<span class="ruby-identifier">index</span>], <span class="ruby-keyword">true</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@prompt_proc</span>
      <span class="ruby-identifier">width</span> = <span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line</span>)
      <span class="ruby-identifier">height</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">width</span>)
      <span class="ruby-identifier">back</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">height</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@highest_in_all</span> = <span class="ruby-identifier">back</span>
    <span class="ruby-ivar">@highest_in_this</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor_max</span>)
    <span class="ruby-ivar">@first_line_started_from</span> =
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line_index</span>.<span class="ruby-identifier">zero?</span>
        <span class="ruby-value">0</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">calculate_height_by_lines</span>(<span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)], <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prompt</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@prompt_proc</span>
      <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">prompt_list</span>[<span class="ruby-ivar">@line_index</span>]
      <span class="ruby-identifier">prompt_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">calculate_nearest_cursor</span>
    <span class="ruby-ivar">@started_from</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>((<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">%</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
    <span class="ruby-ivar">@highest_in_this</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor_max</span>)
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-retrieve_completion_block" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">retrieve_completion_block</span><span
                                class="method-args">(set_completion_quote_character = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="retrieve_completion_block-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1682</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">retrieve_completion_block</span>(<span class="ruby-identifier">set_completion_quote_character</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">completer_word_break_characters</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">word_break_regexp</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">word_break_regexp</span> = <span class="ruby-regexp">/\A[#{Regexp.escape(Reline.completer_word_break_characters)}]/</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">completer_quote_characters</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">quote_characters_regexp</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">quote_characters_regexp</span> = <span class="ruby-regexp">/\A[#{Regexp.escape(Reline.completer_quote_characters)}]/</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">before</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-identifier">rest</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">break_pointer</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">quote</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">closing_quote</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">escaped_quote</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">while</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">slice</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">i</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">i</span>)
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">slice</span>.<span class="ruby-identifier">valid_encoding?</span>
      <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">quote</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">slice</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">closing_quote</span>)
      <span class="ruby-identifier">quote</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">rest</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">quote</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">slice</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">escaped_quote</span>)
      <span class="ruby-comment"># skip</span>
      <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">2</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">quote_characters_regexp</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">slice</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">quote_characters_regexp</span> <span class="ruby-comment"># find new &quot;</span>
      <span class="ruby-identifier">rest</span> = <span class="ruby-node">$&#39;</span>
      <span class="ruby-identifier">quote</span> = <span class="ruby-node">$&amp;</span>
      <span class="ruby-identifier">closing_quote</span> = <span class="ruby-regexp">/(?!\\)#{Regexp.escape(quote)}/</span>
      <span class="ruby-identifier">escaped_quote</span> = <span class="ruby-regexp">/\\#{Regexp.escape(quote)}/</span>
      <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">break_pointer</span> = <span class="ruby-identifier">i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">word_break_regexp</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">quote</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">slice</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">word_break_regexp</span>
      <span class="ruby-identifier">rest</span> = <span class="ruby-node">$&#39;</span>
      <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">before</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">i</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">i</span>)
      <span class="ruby-identifier">break_pointer</span> = <span class="ruby-identifier">i</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">postposing</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">rest</span>
    <span class="ruby-identifier">preposing</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">break_pointer</span>)
    <span class="ruby-identifier">target</span> = <span class="ruby-identifier">rest</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">set_completion_quote_character</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">quote</span>
      <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">core</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value">:@completion_quote_character</span>, <span class="ruby-identifier">quote</span>)
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">postposing</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp">/(?!\\)#{Regexp.escape(quote)}/</span> <span class="ruby-comment"># closing quote</span>
        <span class="ruby-identifier">insert_text</span>(<span class="ruby-identifier">quote</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">preposing</span> = <span class="ruby-string">&#39;&#39;</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">break_pointer</span>
      <span class="ruby-identifier">preposing</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">break_pointer</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">preposing</span> = <span class="ruby-string">&#39;&#39;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">target</span> = <span class="ruby-identifier">before</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">whole_lines</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">preposing</span> = <span class="ruby-identifier">lines</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)].<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">preposing</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> (<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@line_index</span>
      <span class="ruby-identifier">postposing</span> = <span class="ruby-identifier">postposing</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">lines</span>[(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  [<span class="ruby-identifier">preposing</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-ivar">@encoding</span>), <span class="ruby-identifier">target</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-ivar">@encoding</span>), <span class="ruby-identifier">postposing</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-ivar">@encoding</span>)]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reverse_search_history" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">reverse_search_history</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-vi_search_prev">vi_search_prev</a>
                            </div>
                          </div>

                  <div id="method-i-self_insert" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">self_insert</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_insert">ed_insert</a>
                            </div>
                          </div>

                  <div id="method-i-set_mark" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">set_mark</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_set_mark">em_set_mark</a>
                            </div>
                          </div>

                  <div id="method-i-set_pasting_state" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_pasting_state</span><span
                                class="method-args">(in_pasting)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_pasting_state-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 67</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_pasting_state</span>(<span class="ruby-identifier">in_pasting</span>)
  <span class="ruby-ivar">@in_pasting</span> = <span class="ruby-identifier">in_pasting</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_signal_handlers" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_signal_handlers</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_signal_handlers-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 225</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_signal_handlers</span>
  <span class="ruby-ivar">@old_trap</span> = <span class="ruby-constant">Signal</span>.<span class="ruby-identifier">trap</span>(<span class="ruby-string">&#39;INT&#39;</span>) {
    <span class="ruby-identifier">clear_dialog</span>(<span class="ruby-value">0</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span>
      <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> (<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scroll_partial_screen</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-value">1</span>)
    <span class="ruby-keyword">case</span> <span class="ruby-ivar">@old_trap</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;DEFAULT&#39;</span>, <span class="ruby-string">&#39;SYSTEM_DEFAULT&#39;</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">Interrupt</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;IGNORE&#39;</span>
      <span class="ruby-comment"># Do nothing</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;EXIT&#39;</span>
      <span class="ruby-identifier">exit</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@old_trap</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@old_trap</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:call</span>)
    <span class="ruby-keyword">end</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-simplified_rendering-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">simplified_rendering?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="simplified_rendering-3F-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 71</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">simplified_rendering?</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">finished?</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@just_cursor_moving</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@rerender_all</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">not</span> <span class="ruby-ivar">@rerender_all</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">finished?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@in_pasting</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-transpose_chars" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">transpose_chars</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_transpose_chars">ed_transpose_chars</a>
                            </div>
                          </div>

                  <div id="method-i-transpose_words" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">transpose_words</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-ed_transpose_words">ed_transpose_words</a>
                            </div>
                          </div>

                  <div id="method-i-unix_line_discard" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">unix_line_discard</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-vi_kill_line_prev">vi_kill_line_prev</a>
                            </div>
                          </div>

                  <div id="method-i-unix_word_rubout" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">unix_word_rubout</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_kill_region">em_kill_region</a>
                            </div>
                          </div>

                  <div id="method-i-upcase_word" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">upcase_word</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_upper_case">em_upper_case</a>
                            </div>
                          </div>

                  <div id="method-i-vi_end_of_transmission" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">vi_end_of_transmission</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-vi_list_or_eof">vi_list_or_eof</a>
                            </div>
                          </div>

                  <div id="method-i-vi_eof_maybe" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">vi_eof_maybe</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-vi_list_or_eof">vi_list_or_eof</a>
                            </div>
                          </div>

                  <div id="method-i-vi_movement_mode" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">vi_movement_mode</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-vi_command_mode">vi_command_mode</a>
                            </div>
                          </div>

                  <div id="method-i-whole_buffer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">whole_buffer</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="whole_buffer-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1856</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">whole_buffer</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">whole_lines</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-whole_lines" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">whole_lines</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="whole_lines-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1849</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">whole_lines</span>
  <span class="ruby-identifier">index</span> = <span class="ruby-ivar">@previous_line_index</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@line_index</span>
  <span class="ruby-identifier">temp_lines</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-identifier">temp_lines</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-ivar">@line</span>
  <span class="ruby-identifier">temp_lines</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-wrap_method_call" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">wrap_method_call</span><span
                                class="method-args">(method_symbol, method_obj, key, with_operator = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="wrap_method_call-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1421</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">wrap_method_call</span>(<span class="ruby-identifier">method_symbol</span>, <span class="ruby-identifier">method_obj</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">with_operator</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>, <span class="ruby-value">:vi_insert</span>) <span class="ruby-keyword">and</span> <span class="ruby-ivar">@waiting_proc</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@waiting_operator_proc</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">not_insertion</span> = <span class="ruby-identifier">method_symbol</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:ed_insert</span>
    <span class="ruby-identifier">process_insert</span>(<span class="ruby-value">force:</span> <span class="ruby-identifier">not_insertion</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_arg</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">argumentable?</span>(<span class="ruby-identifier">method_obj</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">with_operator</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">inclusive?</span>(<span class="ruby-identifier">method_obj</span>)
      <span class="ruby-identifier">method_obj</span>.(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-ivar">@vi_arg</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-keyword">true</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">method_obj</span>.(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-ivar">@vi_arg</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">with_operator</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">inclusive?</span>(<span class="ruby-identifier">method_obj</span>)
      <span class="ruby-identifier">method_obj</span>.(<span class="ruby-identifier">key</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-keyword">true</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">method_obj</span>.(<span class="ruby-identifier">key</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-yank" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">yank</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_yank">em_yank</a>
                            </div>
                          </div>

                  <div id="method-i-yank_pop" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">yank_pop</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="LineEditor.html#method-i-em_yank_pop">em_yank_pop</a>
                            </div>
                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-argumentable-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">argumentable?</span><span
                                class="method-args">(method_obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="argumentable-3F-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1411</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">argumentable?</span>(<span class="ruby-identifier">method_obj</span>)
  <span class="ruby-identifier">method_obj</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">method_obj</span>.<span class="ruby-identifier">parameters</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span> <span class="ruby-identifier">param</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:key</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">param</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:arg</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-byteinsert" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">byteinsert</span><span
                                class="method-args">(str, byte_pointer, other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="byteinsert-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1880</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">byteinsert</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">byte_pointer</span>, <span class="ruby-identifier">other</span>)
  <span class="ruby-identifier">new_str</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">byte_pointer</span>)
  <span class="ruby-identifier">new_str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">other</span>
  <span class="ruby-identifier">new_str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">byte_pointer</span>, <span class="ruby-identifier">str</span>.<span class="ruby-identifier">bytesize</span>)
  <span class="ruby-identifier">new_str</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-byteslice-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">byteslice!</span><span
                                class="method-args">(str, byte_pointer, size)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="byteslice-21-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1874</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">byteslice!</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">byte_pointer</span>, <span class="ruby-identifier">size</span>)
  <span class="ruby-identifier">new_str</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">byte_pointer</span>)
  <span class="ruby-identifier">new_str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">size</span>, <span class="ruby-identifier">str</span>.<span class="ruby-identifier">bytesize</span>)
  [<span class="ruby-identifier">new_str</span>, <span class="ruby-identifier">str</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">byte_pointer</span>, <span class="ruby-identifier">size</span>)]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-calculate_height_by_lines" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">calculate_height_by_lines</span><span
                                class="method-args">(lines, prompt)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="calculate_height_by_lines-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 322</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">calculate_height_by_lines</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-identifier">prompt</span>)
  <span class="ruby-identifier">result</span> = <span class="ruby-value">0</span>
  <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">prompt</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">prompt</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">prompt_list</span>[<span class="ruby-identifier">i</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">prompt_list</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">prompt_list</span>[<span class="ruby-identifier">i</span>]
    <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-keyword">true</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line</span>))
  }
  <span class="ruby-identifier">result</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-calculate_height_by_width" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">calculate_height_by_width</span><span
                                class="method-args">(width)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="calculate_height_by_width-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 340</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">calculate_height_by_width</span>(<span class="ruby-identifier">width</span>)
  <span class="ruby-identifier">width</span>.<span class="ruby-identifier">div</span>(<span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-calculate_nearest_cursor" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">calculate_nearest_cursor</span><span
                                class="method-args">(line_to_calc = @line, cursor = @cursor, started_from = @started_from, byte_pointer = @byte_pointer, update = true)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="calculate_nearest_cursor-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 378</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">calculate_nearest_cursor</span>(<span class="ruby-identifier">line_to_calc</span> = <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">cursor</span> = <span class="ruby-ivar">@cursor</span>, <span class="ruby-identifier">started_from</span> = <span class="ruby-ivar">@started_from</span>, <span class="ruby-identifier">byte_pointer</span> = <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">update</span> = <span class="ruby-keyword">true</span>)
  <span class="ruby-identifier">new_cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line_to_calc</span>)
  <span class="ruby-identifier">new_cursor</span> = <span class="ruby-value">0</span>
  <span class="ruby-identifier">new_byte_pointer</span> = <span class="ruby-value">0</span>
  <span class="ruby-identifier">height</span> = <span class="ruby-value">1</span>
  <span class="ruby-identifier">max_width</span> = <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
    <span class="ruby-identifier">last_byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-identifier">line_to_calc</span>, <span class="ruby-identifier">line_to_calc</span>.<span class="ruby-identifier">bytesize</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">last_byte_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">last_mbchar</span> = <span class="ruby-identifier">line_to_calc</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">line_to_calc</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">last_byte_size</span>, <span class="ruby-identifier">last_byte_size</span>)
      <span class="ruby-identifier">last_width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">last_mbchar</span>)
      <span class="ruby-identifier">end_of_line_cursor</span> = <span class="ruby-identifier">new_cursor_max</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">last_width</span>
    <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">end_of_line_cursor</span> = <span class="ruby-identifier">new_cursor_max</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
  <span class="ruby-identifier">end_of_line_cursor</span> = <span class="ruby-identifier">new_cursor_max</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">line_to_calc</span>.<span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">gc</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mbchar</span> = <span class="ruby-identifier">gc</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>)
    <span class="ruby-identifier">mbchar_width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-identifier">now</span> = <span class="ruby-identifier">new_cursor</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">mbchar_width</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">now</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">end_of_line_cursor</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">now</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">cursor</span>
      <span class="ruby-keyword">break</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">new_cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">mbchar_width</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_cursor</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">max_width</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">height</span>
      <span class="ruby-identifier">height</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">new_byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">gc</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">new_started_from</span> = <span class="ruby-identifier">height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">update</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">new_cursor</span>
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">new_cursor_max</span>
    <span class="ruby-ivar">@started_from</span> = <span class="ruby-identifier">new_started_from</span>
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">new_byte_pointer</span>
  <span class="ruby-keyword">else</span>
    [<span class="ruby-identifier">new_cursor</span>, <span class="ruby-identifier">new_cursor_max</span>, <span class="ruby-identifier">new_started_from</span>, <span class="ruby-identifier">new_byte_pointer</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-calculate_scroll_partial_screen" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">calculate_scroll_partial_screen</span><span
                                class="method-args">(highest_in_all, cursor_y)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="calculate_scroll_partial_screen-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 878</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">calculate_scroll_partial_screen</span>(<span class="ruby-identifier">highest_in_all</span>, <span class="ruby-identifier">cursor_y</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">highest_in_all</span>
    <span class="ruby-identifier">old_scroll_partial_screen</span> = <span class="ruby-ivar">@scroll_partial_screen</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">cursor_y</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
      <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-value">0</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">cursor_y</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
      <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-identifier">highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@screen_height</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">cursor_y</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-ivar">@scroll_partial_screen</span>
          <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-identifier">cursor_y</span>
        <span class="ruby-keyword">elsif</span> (<span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">cursor_y</span>
          <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-identifier">cursor_y</span> <span class="ruby-operator">-</span> (<span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">cursor_y</span> <span class="ruby-operator">&gt;</span> (<span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
          <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-identifier">cursor_y</span> <span class="ruby-operator">-</span> (<span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
        <span class="ruby-keyword">else</span>
          <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-value">0</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">old_scroll_partial_screen</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@scroll_partial_screen</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-calculate_width" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">calculate_width</span><span
                                class="method-args">(str, allow_escape_code = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="calculate_width-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1887</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">calculate_width</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">allow_escape_code</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">allow_escape_code</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_mode_string" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_mode_string</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_mode_string-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 81</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_mode_string</span>
  <span class="ruby-identifier">mode_string</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">show_mode_in_prompt</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
      <span class="ruby-identifier">mode_string</span> = <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">vi_cmd_mode_string</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_insert</span>)
      <span class="ruby-identifier">mode_string</span> = <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">vi_ins_mode_string</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>)
      <span class="ruby-identifier">mode_string</span> = <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">emacs_mode_string</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">mode_string</span> = <span class="ruby-string">&#39;?&#39;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">mode_string</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@prev_mode_string</span>
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@prev_mode_string</span> = <span class="ruby-identifier">mode_string</span>
  <span class="ruby-identifier">mode_string</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_multiline_prompt" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_multiline_prompt</span><span
                                class="method-args">(buffer, force_recalc: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_multiline_prompt-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 101</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_multiline_prompt</span>(<span class="ruby-identifier">buffer</span>, <span class="ruby-value">force_recalc:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_arg</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-node">&quot;(arg: #{@vi_arg}) &quot;</span>
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@searching_prompt</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-ivar">@searching_prompt</span>
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-ivar">@prompt</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">simplified_rendering?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">force_recalc</span>
    <span class="ruby-identifier">mode_string</span> = <span class="ruby-identifier">check_mode_string</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">mode_string</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">prompt</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mode_string</span>
    <span class="ruby-keyword">return</span> [<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-keyword">true</span>), [<span class="ruby-identifier">prompt</span>] <span class="ruby-operator">*</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@prompt_proc</span>
    <span class="ruby-identifier">use_cached_prompt_list</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cached_prompt_list</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@just_cursor_moving</span>
        <span class="ruby-identifier">use_cached_prompt_list</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">&lt;</span> (<span class="ruby-ivar">@prompt_cache_time</span> <span class="ruby-operator">+</span> <span class="ruby-constant">PROMPT_LIST_CACHE_TIMEOUT</span>) <span class="ruby-keyword">and</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@cached_prompt_list</span>.<span class="ruby-identifier">size</span>
        <span class="ruby-identifier">use_cached_prompt_list</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">use_cached_prompt_list</span> = <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@rerender_all</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">use_cached_prompt_list</span>
      <span class="ruby-identifier">prompt_list</span> = <span class="ruby-ivar">@cached_prompt_list</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">prompt_list</span> = <span class="ruby-ivar">@cached_prompt_list</span> = <span class="ruby-ivar">@prompt_proc</span>.(<span class="ruby-identifier">buffer</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">&quot;\n&quot;</span>, <span class="ruby-string">&quot;\\n&quot;</span>) }
      <span class="ruby-ivar">@prompt_cache_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">prompt_list</span>.<span class="ruby-identifier">map!</span>{ <span class="ruby-identifier">prompt</span> } <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_arg</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@searching_prompt</span>
    <span class="ruby-identifier">prompt_list</span> = [<span class="ruby-identifier">prompt</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">prompt_list</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">mode_string</span> = <span class="ruby-identifier">check_mode_string</span>
    <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">prompt_list</span>.<span class="ruby-identifier">map</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">pr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mode_string</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">pr</span> } <span class="ruby-keyword">if</span> <span class="ruby-identifier">mode_string</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">prompt_list</span>[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">prompt_list</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">prompt</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">prompt_list</span>.<span class="ruby-identifier">last</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">prompt</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">prompt_list</span>.<span class="ruby-identifier">size</span>
      (<span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">prompt_list</span>.<span class="ruby-identifier">size</span>).<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span>
        <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">prompt_list</span>.<span class="ruby-identifier">last</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">prompt_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-keyword">true</span>)
    [<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span>]
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">mode_string</span> = <span class="ruby-identifier">check_mode_string</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">mode_string</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">prompt</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mode_string</span>
    <span class="ruby-identifier">prompt_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-keyword">true</span>)
    [<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-keyword">nil</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clear_dialog" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear_dialog</span><span
                                class="method-args">(cursor_column)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clear_dialog-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 862</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_dialog</span>(<span class="ruby-identifier">cursor_column</span>)
  <span class="ruby-identifier">changes</span> = <span class="ruby-ivar">@dialogs</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dialog</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">old_dialog</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">dup</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">contents</span> = <span class="ruby-keyword">nil</span>
    [<span class="ruby-identifier">old_dialog</span>, <span class="ruby-identifier">dialog</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">render_dialog_changes</span>(<span class="ruby-identifier">changes</span>, <span class="ruby-identifier">cursor_column</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clear_dialog_with_trap_key" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear_dialog_with_trap_key</span><span
                                class="method-args">(cursor_column)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clear_dialog_with_trap_key-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 871</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_dialog_with_trap_key</span>(<span class="ruby-identifier">cursor_column</span>)
  <span class="ruby-identifier">clear_dialog</span>(<span class="ruby-identifier">cursor_column</span>)
  <span class="ruby-ivar">@dialogs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dialog</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">trap_key</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clear_screen_buffer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear_screen_buffer</span><span
                                class="method-args">(prompt, prompt_list, prompt_width)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clear_screen_buffer-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1208</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_screen_buffer</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_list</span>, <span class="ruby-identifier">prompt_width</span>)
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">clear_screen</span>
  <span class="ruby-identifier">back</span> = <span class="ruby-value">0</span>
  <span class="ruby-identifier">modify_lines</span>(<span class="ruby-identifier">whole_lines</span>).<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@prompt_proc</span>
      <span class="ruby-identifier">pr</span> = <span class="ruby-identifier">prompt_list</span>[<span class="ruby-identifier">index</span>]
      <span class="ruby-identifier">height</span> = <span class="ruby-identifier">render_partial</span>(<span class="ruby-identifier">pr</span>, <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">pr</span>), <span class="ruby-identifier">line</span>, <span class="ruby-identifier">back</span>, <span class="ruby-value">with_control:</span> <span class="ruby-keyword">false</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">height</span> = <span class="ruby-identifier">render_partial</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">line</span>, <span class="ruby-identifier">back</span>, <span class="ruby-value">with_control:</span> <span class="ruby-keyword">false</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">index</span> <span class="ruby-operator">&lt;</span> (<span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
      <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-value">1</span>)
      <span class="ruby-identifier">back</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">height</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">back</span>)
  <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span>)
  <span class="ruby-ivar">@rest_height</span> = (<span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">get_screen_size</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">-</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">cursor_pos</span>.<span class="ruby-identifier">y</span>
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>((<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">%</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-complete" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">complete</span><span
                                class="method-args">(list, just_show_list = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="complete-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1283</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">complete</span>(<span class="ruby-identifier">list</span>, <span class="ruby-identifier">just_show_list</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-ivar">@completion_state</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">NORMAL</span>, <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">JOURNEY</span>
    <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">COMPLETION</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">PERFECT_MATCH</span>
    <span class="ruby-ivar">@dig_perfect_match_proc</span>&amp;.(<span class="ruby-ivar">@perfect_matched</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">just_show_list</span>
    <span class="ruby-identifier">is_menu</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@completion_state</span> <span class="ruby-operator">==</span> <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">MENU</span>
    <span class="ruby-identifier">is_menu</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@completion_state</span> <span class="ruby-operator">==</span> <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">MENU_WITH_PERFECT_MATCH</span>
    <span class="ruby-identifier">is_menu</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">is_menu</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">complete_internal_proc</span>(<span class="ruby-identifier">list</span>, <span class="ruby-identifier">is_menu</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@completion_state</span> <span class="ruby-operator">==</span> <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">MENU_WITH_PERFECT_MATCH</span>
    <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">PERFECT_MATCH</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-identifier">target</span>, <span class="ruby-identifier">preposing</span>, <span class="ruby-identifier">completed</span>, <span class="ruby-identifier">postposing</span> = <span class="ruby-identifier">result</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">completed</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">target</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">completed</span> <span class="ruby-keyword">and</span> (<span class="ruby-ivar">@completion_state</span> <span class="ruby-operator">==</span> <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">COMPLETION</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">completed</span>)
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">one?</span>
        <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">PERFECT_MATCH</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">MENU_WITH_PERFECT_MATCH</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@perfect_matched</span> = <span class="ruby-identifier">completed</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">MENU</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">just_show_list</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">target</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">completed</span>
      <span class="ruby-ivar">@line</span> = (<span class="ruby-identifier">preposing</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">completed</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">completion_append_character</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">postposing</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)[<span class="ruby-ivar">@line_index</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)
      <span class="ruby-identifier">line_to_pointer</span> = (<span class="ruby-identifier">preposing</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">completed</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">completion_append_character</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">last</span> <span class="ruby-operator">||</span> <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
      <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line_to_pointer</span>)
      <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">line_to_pointer</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-complete_internal_proc" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">complete_internal_proc</span><span
                                class="method-args">(list, is_menu)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="complete_internal_proc-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1237</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">complete_internal_proc</span>(<span class="ruby-identifier">list</span>, <span class="ruby-identifier">is_menu</span>)
  <span class="ruby-identifier">preposing</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">postposing</span> = <span class="ruby-identifier">retrieve_completion_block</span>
  <span class="ruby-identifier">list</span> = <span class="ruby-identifier">list</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-constant">Encoding</span>.<span class="ruby-identifier">compatible?</span>(<span class="ruby-identifier">target</span>.<span class="ruby-identifier">encoding</span>, <span class="ruby-identifier">i</span>.<span class="ruby-identifier">encoding</span>)
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">CompatibilityError</span>, <span class="ruby-node">&quot;#{target.encoding.name} is not compatible with #{i.encoding.name}&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">completion_ignore_case</span>
      <span class="ruby-identifier">i</span>&amp;.<span class="ruby-identifier">downcase</span>&amp;.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">target</span>.<span class="ruby-identifier">downcase</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">i</span>&amp;.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">target</span>)
    <span class="ruby-keyword">end</span>
  }.<span class="ruby-identifier">uniq</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">is_menu</span>
    <span class="ruby-identifier">menu</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">list</span>)
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">completed</span> = <span class="ruby-identifier">list</span>.<span class="ruby-identifier">inject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">memo</span>, <span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">memo_mbchars</span> = <span class="ruby-identifier">memo</span>.<span class="ruby-identifier">unicode_normalize</span>.<span class="ruby-identifier">grapheme_clusters</span>
      <span class="ruby-identifier">item_mbchars</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">unicode_normalize</span>.<span class="ruby-identifier">grapheme_clusters</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">CompatibilityError</span>
      <span class="ruby-identifier">memo_mbchars</span> = <span class="ruby-identifier">memo</span>.<span class="ruby-identifier">grapheme_clusters</span>
      <span class="ruby-identifier">item_mbchars</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">grapheme_clusters</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">size</span> = [<span class="ruby-identifier">memo_mbchars</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">item_mbchars</span>.<span class="ruby-identifier">size</span>].<span class="ruby-identifier">min</span>
    <span class="ruby-identifier">result</span> = <span class="ruby-string">&#39;&#39;</span>
    <span class="ruby-identifier">size</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">completion_ignore_case</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">memo_mbchars</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">casecmp?</span>(<span class="ruby-identifier">item_mbchars</span>[<span class="ruby-identifier">i</span>])
          <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">memo_mbchars</span>[<span class="ruby-identifier">i</span>]
        <span class="ruby-keyword">else</span>
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">memo_mbchars</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">item_mbchars</span>[<span class="ruby-identifier">i</span>]
          <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">memo_mbchars</span>[<span class="ruby-identifier">i</span>]
        <span class="ruby-keyword">else</span>
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">result</span>
  }
  [<span class="ruby-identifier">target</span>, <span class="ruby-identifier">preposing</span>, <span class="ruby-identifier">completed</span>, <span class="ruby-identifier">postposing</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-copy_for_vi" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">copy_for_vi</span><span
                                class="method-args">(text)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="copy_for_vi-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2804</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">copy_for_vi</span>(<span class="ruby-identifier">text</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_insert</span>) <span class="ruby-keyword">or</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
    <span class="ruby-ivar">@vi_clipboard</span> = <span class="ruby-identifier">text</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-dialog_range" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">dialog_range</span><span
                                class="method-args">(dialog, dialog_y)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="dialog_range-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 671</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dialog_range</span>(<span class="ruby-identifier">dialog</span>, <span class="ruby-identifier">dialog_y</span>)
  <span class="ruby-identifier">x_range</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">column</span><span class="ruby-operator">...</span><span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">column</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">width</span>
  <span class="ruby-identifier">y_range</span> = <span class="ruby-identifier">dialog_y</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">vertical_offset</span><span class="ruby-operator">...</span><span class="ruby-identifier">dialog_y</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">vertical_offset</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span>
  [<span class="ruby-identifier">x_range</span>, <span class="ruby-identifier">y_range</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ed_argument_digit" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_argument_digit</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_argument_digit-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3103</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_argument_digit</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_arg</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">zero?</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">anybits?</span>(<span class="ruby-value">0b10000000</span>)
        <span class="ruby-identifier">unescaped_key</span> = <span class="ruby-identifier">key</span> <span class="ruby-operator">^</span> <span class="ruby-value">0b10000000</span>
        <span class="ruby-keyword">unless</span> <span class="ruby-identifier">unescaped_key</span>.<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">zero?</span>
          <span class="ruby-ivar">@vi_arg</span> = <span class="ruby-identifier">unescaped_key</span>.<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">to_i</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@vi_arg</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">to_i</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@vi_arg</span> = <span class="ruby-ivar">@vi_arg</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">to_i</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ed_clear_screen" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_clear_screen</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_clear_screen-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2668</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_clear_screen</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@cleared</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-clear_screen">clear_screen</a>
                            </div>

                          </div>

                  <div id="method-i-ed_delete_next_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_delete_next_char</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_delete_next_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3015</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_delete_next_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">byte_size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">mbchar</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-identifier">copy_for_vi</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@cursor_max</span>
      <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
      <span class="ruby-identifier">mbchar</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">byte_size</span>)
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
      <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">ed_delete_next_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ed_delete_prev_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_delete_prev_char</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_delete_prev_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2933</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_delete_prev_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-identifier">deleted</span> = <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
      <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
      <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">mbchar</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
      <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">prepend</span>(<span class="ruby-identifier">mbchar</span>)
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
      <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">copy_for_vi</span>(<span class="ruby-identifier">deleted</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ed_delete_prev_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_delete_prev_word</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_delete_prev_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2701</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_delete_prev_word</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">em_backward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">word</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">append</span>(<span class="ruby-identifier">word</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-backward_kill_word">backward_kill_word</a>
                            </div>

                          </div>

                  <div id="method-i-ed_insert" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_insert</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <dl class="rdoc-list note-list"><dt>Editline
<dd>
<p><code>ed-insert</code> (vi input: almost all; emacs: printable characters) In insert mode, insert the input character left of the cursor position. In replace mode, overwrite the character at the cursor and move the cursor to the right by one character position. Accept an argument to do this repeatedly. It is an error if the input character is the NUL character (<code>Ctrl-@</code>). Failure to enlarge the edit buffer also results in an error.</p>
</dd><dt>Editline
<dd>
<p><code>ed-digit</code> (emacs: 0 to 9) If in argument input mode, append the input digit to the argument being read. Otherwise, call <code>ed-insert</code>. It is an error if the input character is not a digit or if the existing argument is already greater than a million.</p>
</dd><dt>GNU Readline
<dd>
<p><code>self-insert</code> (a, b, A, 1, !, …) Insert yourself.</p>
</dd></dl>

                              <div class="method-source-code" id="ed_insert-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1944</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_insert</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">str</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">width</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">bytesize</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">String</span>)
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">key</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>)
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UndefinedConversionError</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">str</span> = <span class="ruby-identifier">key</span>
    <span class="ruby-identifier">bytesize</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">key</span>.<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>)
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UndefinedConversionError</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">str</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">chr</span>
    <span class="ruby-identifier">bytesize</span> = <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@in_pasting</span>
    <span class="ruby-ivar">@continuous_insertion_buffer</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@continuous_insertion_buffer</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">process_insert</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">str</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@cursor_max</span>
    <span class="ruby-ivar">@line</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">str</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">byteinsert</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">str</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">last_byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">bytesize</span>
  <span class="ruby-identifier">last_mbchar</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>((<span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">last_byte_size</span>), <span class="ruby-identifier">last_byte_size</span>)
  <span class="ruby-identifier">combined_char</span> = <span class="ruby-identifier">last_mbchar</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">str</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">last_byte_size</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">combined_char</span>.<span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
    <span class="ruby-comment"># combined char</span>
    <span class="ruby-identifier">last_mbchar_width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">last_mbchar</span>)
    <span class="ruby-identifier">combined_char_width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">combined_char</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">combined_char_width</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">last_mbchar_width</span>
      <span class="ruby-identifier">width</span> = <span class="ruby-identifier">combined_char_width</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">last_mbchar_width</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">width</span> = <span class="ruby-value">0</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-ed_digit">ed_digit</a>, <a href="LineEditor.html#method-i-self_insert">self_insert</a>
                            </div>

                          </div>

                  <div id="method-i-ed_kill_line" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_kill_line</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <dl class="rdoc-list note-list"><dt>Editline
<dd>
<p><code>ed-kill-line</code> (vi command: <code>D</code>, <code>Ctrl-K</code>; emacs: <code>Ctrl-K</code>, <code>Ctrl-U</code>) + Kill from the cursor to the end of the line.</p>
</dd><dt>GNU Readline
<dd>
<p><code>kill-line</code> (<code>C-k</code>) Kill the text from point to the end of the line. With a negative numeric argument, kill backward from the cursor to the beginning of the current line.</p>
</dd></dl>

                              <div class="method-source-code" id="ed_kill_line-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2551</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_kill_line</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">deleted</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">append</span>(<span class="ruby-identifier">deleted</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@line</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>] = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-kill_line">kill_line</a>
                            </div>

                          </div>

                  <div id="method-i-ed_move_to_beg" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_move_to_beg</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_move_to_beg-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2057</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_move_to_beg</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-beginning_of_line">beginning_of_line</a>
                            </div>

                          </div>

                  <div id="method-i-ed_move_to_end" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_move_to_end</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_move_to_end-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2062</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_move_to_end</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
  <span class="ruby-identifier">byte_size</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">while</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">mbchar</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-end_of_line">end_of_line</a>
                            </div>

                          </div>

                  <div id="method-i-ed_newline" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_newline</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_newline-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2490</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_newline</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">process_insert</span>(<span class="ruby-value">force:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&lt;</span> (<span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
        <span class="ruby-identifier">ed_next_history</span>(<span class="ruby-identifier">key</span>) <span class="ruby-comment"># means cursor down</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-comment"># should check confirm_multiline_termination to finish?</span>
        <span class="ruby-identifier">finish</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">==</span> (<span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">confirm_multiline_termination</span>
          <span class="ruby-identifier">finish</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">key_newline</span>(<span class="ruby-identifier">key</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-comment"># should check confirm_multiline_termination to finish?</span>
        <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-ivar">@line_index</span>
        <span class="ruby-ivar">@line_index</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
        <span class="ruby-identifier">finish</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>] = <span class="ruby-ivar">@line</span>
      <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">finish</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ed_next_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_next_char</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_next_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2013</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_next_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>)
    <span class="ruby-identifier">mbchar</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">width</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>) <span class="ruby-keyword">and</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
    <span class="ruby-identifier">next_line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>]
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">next_line</span>)
    <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-ivar">@line_index</span>
    <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">ed_next_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-forward_char">forward_char</a>
                            </div>

                          </div>

                  <div id="method-i-ed_next_history" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_next_history</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_next_history-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2442</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_next_history</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&lt;</span> (<span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-ivar">@line_index</span>
    <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">==</span> (<span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
      <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-ivar">@line_backup_in_history</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
      <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-ivar">@line_index</span> = <span class="ruby-value">0</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">first</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@line_backup_in_history</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>] = <span class="ruby-identifier">whole_buffer</span>
      <span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
      <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-ivar">@line_index</span> = <span class="ruby-value">0</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">first</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>] = <span class="ruby-ivar">@line</span>
      <span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@line</span> = <span class="ruby-string">&#39;&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@line</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>, <span class="ruby-value">:vi_insert</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">ed_next_history</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-next_history">next_history</a>
                            </div>

                          </div>

                  <div id="method-i-ed_prev_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_prev_char</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_prev_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2033</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_prev_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-identifier">mbchar</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>) <span class="ruby-keyword">and</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">prev_line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prev_line</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">prev_line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prev_line</span>)
    <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-ivar">@line_index</span>
    <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">ed_prev_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-backward_char">backward_char</a>
                            </div>

                          </div>

                  <div id="method-i-ed_prev_history" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_prev_history</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_prev_history-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2391</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_prev_history</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-ivar">@line_index</span>
    <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
      <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-identifier">whole_buffer</span>
      <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
      <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-ivar">@line_index</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">last</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-ivar">@line</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">zero?</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>] = <span class="ruby-identifier">whole_buffer</span>
      <span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
      <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-ivar">@line_index</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">last</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>] = <span class="ruby-ivar">@line</span>
      <span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>, <span class="ruby-value">:vi_insert</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">ed_prev_history</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-previous_history">previous_history</a>
                            </div>

                          </div>

                  <div id="method-i-ed_prev_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_prev_word</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_prev_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2682</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_prev_word</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">em_backward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-backward_word">backward_word</a>
                            </div>

                          </div>

                  <div id="method-i-ed_quoted_insert" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_quoted_insert</span><span
                                class="method-args">(str, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_quoted_insert-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1997</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_quoted_insert</span>(<span class="ruby-identifier">str</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-identifier">proc</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\C-j&quot;</span>.<span class="ruby-identifier">ord</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\C-m&quot;</span>.<span class="ruby-identifier">ord</span>
        <span class="ruby-identifier">key_newline</span>(<span class="ruby-identifier">key</span>)
      <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
        <span class="ruby-comment"># Ignore NUL.</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">ed_insert</span>(<span class="ruby-identifier">key</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-quoted_insert">quoted_insert</a>
                            </div>

                          </div>

                  <div id="method-i-ed_search_next_history" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_search_next_history</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_search_next_history-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2339</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_search_next_history</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-identifier">substr</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">slice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">==</span> (<span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">substr</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">slice</span>((<span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>)
  <span class="ruby-identifier">h_pointer</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">line_no</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-identifier">h_pointer</span> = <span class="ruby-identifier">history</span>.<span class="ruby-identifier">index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">h</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">substr</span>)
          <span class="ruby-identifier">line_no</span> = <span class="ruby-identifier">i</span>
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
      }
      <span class="ruby-keyword">not</span> <span class="ruby-identifier">line_no</span>.<span class="ruby-identifier">nil?</span>
    }
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">h_pointer</span> = <span class="ruby-identifier">history</span>.<span class="ruby-identifier">index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">l</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">substr</span>)
    }
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">h_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">h_pointer</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@history_pointer</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">h_pointer</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">substr</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-identifier">h_pointer</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">substr</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-ivar">@buffer_of_lines</span> = []
      <span class="ruby-ivar">@line_index</span> = <span class="ruby-value">0</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
      <span class="ruby-ivar">@line_index</span> = <span class="ruby-identifier">line_no</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">substr</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-string">&#39;&#39;</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">ed_search_next_history</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-history_search_forward">history_search_forward</a>
                            </div>

                          </div>

                  <div id="method-i-ed_search_prev_history" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_search_prev_history</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_search_prev_history-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2292</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_search_prev_history</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-identifier">history</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">h_pointer</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">line_no</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">substr</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">slice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">substr</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">zero?</span>
    <span class="ruby-identifier">history</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">h_pointer</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">slice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@history_pointer</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">history</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-identifier">h_pointer</span> = <span class="ruby-identifier">history</span>.<span class="ruby-identifier">rindex</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">h</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">substr</span>)
          <span class="ruby-identifier">line_no</span> = <span class="ruby-identifier">i</span>
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
      }
      <span class="ruby-keyword">not</span> <span class="ruby-identifier">line_no</span>.<span class="ruby-identifier">nil?</span>
    }
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">h_pointer</span> = <span class="ruby-identifier">history</span>.<span class="ruby-identifier">rindex</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">l</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">substr</span>)
    }
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">h_pointer</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-identifier">h_pointer</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
    <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-ivar">@line_index</span> = <span class="ruby-identifier">line_no</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">ed_search_prev_history</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-history_search_backward">history_search_backward</a>
                            </div>

                          </div>

                  <div id="method-i-ed_transpose_chars" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_transpose_chars</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_transpose_chars-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2713</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_transpose_chars</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@cursor</span>
      <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
      <span class="ruby-identifier">mbchar</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
      <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">back1_byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">back1_byte_size</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">back2_byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">back1_byte_size</span>)
      <span class="ruby-identifier">back2_pointer</span> = <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">back1_byte_size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">back2_byte_size</span>
      <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">back2_mbchar</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-identifier">back2_pointer</span>, <span class="ruby-identifier">back2_byte_size</span>)
      <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">byteinsert</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">back2_byte_size</span>, <span class="ruby-identifier">back2_mbchar</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-transpose_chars">transpose_chars</a>
                            </div>

                          </div>

                  <div id="method-i-ed_transpose_words" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_transpose_words</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ed_transpose_words-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2733</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_transpose_words</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">left_word_start</span>, <span class="ruby-identifier">middle_start</span>, <span class="ruby-identifier">right_word_start</span>, <span class="ruby-identifier">after_start</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">ed_transpose_words</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
  <span class="ruby-identifier">before</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">left_word_start</span>)
  <span class="ruby-identifier">left_word</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">left_word_start</span>, <span class="ruby-identifier">middle_start</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">left_word_start</span>)
  <span class="ruby-identifier">middle</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">middle_start</span>, <span class="ruby-identifier">right_word_start</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">middle_start</span>)
  <span class="ruby-identifier">right_word</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">right_word_start</span>, <span class="ruby-identifier">after_start</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">right_word_start</span>)
  <span class="ruby-identifier">after</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">after_start</span>, <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">after_start</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">left_word</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">right_word</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">before</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">right_word</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">middle</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">left_word</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">after</span>
  <span class="ruby-identifier">from_head_to_left_word</span> = <span class="ruby-identifier">before</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">right_word</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">middle</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">left_word</span>
  <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">from_head_to_left_word</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">from_head_to_left_word</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-transpose_words">transpose_words</a>
                            </div>

                          </div>

                  <div id="method-i-ed_unassigned" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ed_unassigned</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <dl class="rdoc-list note-list"><dt>Editline
<dd>
<p><code>ed-unassigned</code> This  editor command always results in an error.</p>
</dd><dt>GNU Readline
<dd>
<p>There is no corresponding macro.</p>
</dd></dl>

                              <div class="method-source-code" id="ed_unassigned-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1914</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ed_unassigned</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-em_capitol_case" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_capitol_case</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_capitol_case-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2748</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_capitol_case</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">_</span>, <span class="ruby-identifier">new_str</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">em_forward_word_with_capitalization</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-identifier">before</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-identifier">after</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>((<span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_size</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>)
    <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">before</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">new_str</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">after</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">new_str</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">new_str</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-capitalize_word">capitalize_word</a>
                            </div>

                          </div>

                  <div id="method-i-em_delete" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_delete</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_delete-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2600</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_delete</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> (<span class="ruby-keyword">not</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>) <span class="ruby-keyword">and</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\C-d&quot;</span>.<span class="ruby-identifier">ord</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">scroll_down</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@first_line_started_from</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
    <span class="ruby-ivar">@eof</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-identifier">finish</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-identifier">splitted_last</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>)
    <span class="ruby-identifier">mbchar</span> = <span class="ruby-identifier">splitted_last</span>.<span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">first</span>
    <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-ivar">@line</span>, = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">mbchar</span>.<span class="ruby-identifier">bytesize</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@line</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>] = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-delete_char">delete_char</a>
                            </div>

                          </div>

                  <div id="method-i-em_delete_next_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_delete_next_word</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_delete_next_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2691</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_delete_next_word</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">em_forward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">word</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">append</span>(<span class="ruby-identifier">word</span>)
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-kill_word">kill_word</a>
                            </div>

                          </div>

                  <div id="method-i-em_delete_or_list" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_delete_or_list</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_delete_or_list-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2627</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_delete_or_list</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-identifier">em_delete</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">else</span> <span class="ruby-comment"># show completed list</span>
    <span class="ruby-identifier">result</span> = <span class="ruby-identifier">call_completion_proc</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
      <span class="ruby-identifier">complete</span>(<span class="ruby-identifier">result</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-delete_char_or_list">delete_char_or_list</a>
                            </div>

                          </div>

                  <div id="method-i-em_delete_prev_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_delete_prev_char</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_delete_prev_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2523</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_delete_prev_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>] = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>])
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">+=</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-ivar">@line_index</span>)
    <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">mbchar</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">em_delete_prev_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-backward_delete_char">backward_delete_char</a>
                            </div>

                          </div>

                  <div id="method-i-em_exchange_mark" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_exchange_mark</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_exchange_mark-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3287</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_exchange_mark</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@mark_pointer</span>
  <span class="ruby-identifier">new_pointer</span> = [<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@line_index</span>]
  <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-ivar">@line_index</span>
  <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@line_index</span> = <span class="ruby-ivar">@mark_pointer</span>
  <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>))
  <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-ivar">@mark_pointer</span> = <span class="ruby-identifier">new_pointer</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-exchange_point_and_mark">exchange_point_and_mark</a>
                            </div>

                          </div>

                  <div id="method-i-em_kill_line" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_kill_line</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <dl class="rdoc-list note-list"><dt>Editline
<dd>
<p><code>em-kill-line</code> (not bound) Delete the entire contents of the edit buffer and save it to the cut buffer. <code>vi-kill-line-prev</code></p>
</dd><dt>GNU Readline
<dd>
<p><code>kill-whole-line</code> (not bound) Kill all characters on the current line, no matter where point is.</p>
</dd></dl>

                              <div class="method-source-code" id="em_kill_line-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2589</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_kill_line</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">append</span>(<span class="ruby-ivar">@line</span>.<span class="ruby-identifier">dup</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">clear</span>
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-kill_whole_line">kill_whole_line</a>
                            </div>

                          </div>

                  <div id="method-i-em_kill_region" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_kill_region</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_kill_region-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2792</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_kill_region</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">em_big_backward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">deleted</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">append</span>(<span class="ruby-identifier">deleted</span>, <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-unix_word_rubout">unix_word_rubout</a>
                            </div>

                          </div>

                  <div id="method-i-em_lower_case" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_lower_case</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_lower_case-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2760</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_lower_case</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">em_forward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-identifier">part</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>).<span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mbchar</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">mbchar</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/[A-Z]/</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">mbchar</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">mbchar</span>
    }.<span class="ruby-identifier">join</span>
    <span class="ruby-identifier">rest</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>((<span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_size</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>)
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">part</span>
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">rest</span>)
    <span class="ruby-ivar">@line</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">rest</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-downcase_word">downcase_word</a>
                            </div>

                          </div>

                  <div id="method-i-em_meta_next" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_meta_next</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_meta_next-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3298</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_meta_next</span>(<span class="ruby-identifier">key</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-em_next_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_next_word</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_next_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2673</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_next_word</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">em_forward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-forward_word">forward_word</a>
                            </div>

                          </div>

                  <div id="method-i-em_set_mark" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_set_mark</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_set_mark-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3282</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_set_mark</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@mark_pointer</span> = [<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@line_index</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-set_mark">set_mark</a>
                            </div>

                          </div>

                  <div id="method-i-em_upper_case" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_upper_case</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_upper_case-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2776</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_upper_case</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">em_forward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-identifier">part</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>).<span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mbchar</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">mbchar</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/[a-z]/</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">mbchar</span>.<span class="ruby-identifier">upcase</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">mbchar</span>
    }.<span class="ruby-identifier">join</span>
    <span class="ruby-identifier">rest</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>((<span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_size</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>)
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">part</span>
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">rest</span>)
    <span class="ruby-ivar">@line</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">rest</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-upcase_word">upcase_word</a>
                            </div>

                          </div>

                  <div id="method-i-em_yank" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_yank</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_yank-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2639</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_yank</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">yanked</span> = <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">yank</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">yanked</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">byteinsert</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">yanked</span>)
    <span class="ruby-identifier">yanked_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">yanked</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">yanked_width</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">yanked_width</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">yanked</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-yank">yank</a>
                            </div>

                          </div>

                  <div id="method-i-em_yank_pop" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">em_yank_pop</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="em_yank_pop-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2651</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">em_yank_pop</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">yanked</span>, <span class="ruby-identifier">prev_yank</span> = <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">yank_pop</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">yanked</span>
    <span class="ruby-identifier">prev_yank_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prev_yank</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">prev_yank_width</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">prev_yank_width</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">prev_yank</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@line</span>, = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">prev_yank</span>.<span class="ruby-identifier">bytesize</span>)
    <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">byteinsert</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">yanked</span>)
    <span class="ruby-identifier">yanked_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">yanked</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">yanked_width</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">yanked_width</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">yanked</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-yank_pop">yank_pop</a>
                            </div>

                          </div>

                  <div id="method-i-generate_searcher" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_searcher</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="generate_searcher-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2077</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_searcher</span>
  <span class="ruby-constant">Fiber</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">first_key</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">prev_search_key</span> = <span class="ruby-identifier">first_key</span>
    <span class="ruby-identifier">search_word</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)
    <span class="ruby-identifier">multibyte_buf</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-string">&#39;ASCII-8BIT&#39;</span>)
    <span class="ruby-identifier">last_hit</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">first_key</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-r&quot;</span>.<span class="ruby-identifier">ord</span>
      <span class="ruby-identifier">prompt_name</span> = <span class="ruby-string">&#39;reverse-i-search&#39;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-s&quot;</span>.<span class="ruby-identifier">ord</span>
      <span class="ruby-identifier">prompt_name</span> = <span class="ruby-string">&#39;i-search&#39;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
      <span class="ruby-identifier">key</span> = <span class="ruby-constant">Fiber</span>.<span class="ruby-identifier">yield</span>(<span class="ruby-identifier">search_word</span>)
      <span class="ruby-identifier">search_again</span> = <span class="ruby-keyword">false</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">key</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">-1</span> <span class="ruby-comment"># determined</span>
        <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">last_incremental_search</span> = <span class="ruby-identifier">search_word</span>
        <span class="ruby-keyword">break</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-h&quot;</span>.<span class="ruby-identifier">ord</span>, <span class="ruby-string">&quot;\C-?&quot;</span>.<span class="ruby-identifier">ord</span>
        <span class="ruby-identifier">grapheme_clusters</span> = <span class="ruby-identifier">search_word</span>.<span class="ruby-identifier">grapheme_clusters</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
          <span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">pop</span>
          <span class="ruby-identifier">search_word</span> = <span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">join</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-r&quot;</span>.<span class="ruby-identifier">ord</span>, <span class="ruby-string">&quot;\C-s&quot;</span>.<span class="ruby-identifier">ord</span>
        <span class="ruby-identifier">search_again</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">prev_search_key</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">key</span>
        <span class="ruby-identifier">prev_search_key</span> = <span class="ruby-identifier">key</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">multibyte_buf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">key</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">multibyte_buf</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-ivar">@encoding</span>).<span class="ruby-identifier">valid_encoding?</span>
          <span class="ruby-identifier">search_word</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">multibyte_buf</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-ivar">@encoding</span>)
          <span class="ruby-identifier">multibyte_buf</span>.<span class="ruby-identifier">clear</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">hit</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">search_word</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_backup_in_history</span>&amp;.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">search_word</span>)
        <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-keyword">nil</span>
        <span class="ruby-identifier">hit</span> = <span class="ruby-ivar">@line_backup_in_history</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">search_again</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">search_word</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">last_incremental_search</span>
            <span class="ruby-identifier">search_word</span> = <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">last_incremental_search</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>
            <span class="ruby-keyword">case</span> <span class="ruby-identifier">prev_search_key</span>
            <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-r&quot;</span>.<span class="ruby-identifier">ord</span>
              <span class="ruby-identifier">history_pointer_base</span> = <span class="ruby-value">0</span>
              <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)]
            <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-s&quot;</span>.<span class="ruby-identifier">ord</span>
              <span class="ruby-identifier">history_pointer_base</span> = <span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
              <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[(<span class="ruby-ivar">@history_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">history_pointer_base</span> = <span class="ruby-value">0</span>
            <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@history_pointer</span>
          <span class="ruby-keyword">case</span> <span class="ruby-identifier">prev_search_key</span>
          <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-r&quot;</span>.<span class="ruby-identifier">ord</span>
            <span class="ruby-identifier">history_pointer_base</span> = <span class="ruby-value">0</span>
            <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-ivar">@history_pointer</span>]
          <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-s&quot;</span>.<span class="ruby-identifier">ord</span>
            <span class="ruby-identifier">history_pointer_base</span> = <span class="ruby-ivar">@history_pointer</span>
            <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">history_pointer_base</span> = <span class="ruby-value">0</span>
          <span class="ruby-identifier">history</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">case</span> <span class="ruby-identifier">prev_search_key</span>
        <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-r&quot;</span>.<span class="ruby-identifier">ord</span>
          <span class="ruby-identifier">hit_index</span> = <span class="ruby-identifier">history</span>.<span class="ruby-identifier">rindex</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
            <span class="ruby-identifier">item</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">search_word</span>)
          }
        <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-s&quot;</span>.<span class="ruby-identifier">ord</span>
          <span class="ruby-identifier">hit_index</span> = <span class="ruby-identifier">history</span>.<span class="ruby-identifier">index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
            <span class="ruby-identifier">item</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">search_word</span>)
          }
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">hit_index</span>
          <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-identifier">history_pointer_base</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">hit_index</span>
          <span class="ruby-identifier">hit</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">prev_search_key</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-r&quot;</span>.<span class="ruby-identifier">ord</span>
        <span class="ruby-identifier">prompt_name</span> = <span class="ruby-string">&#39;reverse-i-search&#39;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-s&quot;</span>.<span class="ruby-identifier">ord</span>
        <span class="ruby-identifier">prompt_name</span> = <span class="ruby-string">&#39;i-search&#39;</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">hit</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
          <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-identifier">hit</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
          <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
          <span class="ruby-ivar">@line_index</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
          <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">last</span>
          <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
          <span class="ruby-ivar">@cursor</span> = <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
          <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
          <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-string">&quot;(%s)`%s&#39;&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">prompt_name</span>, <span class="ruby-identifier">search_word</span>]
        <span class="ruby-keyword">else</span>
          <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">hit</span>
          <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-string">&quot;(%s)`%s&#39;: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">prompt_name</span>, <span class="ruby-identifier">search_word</span>, <span class="ruby-identifier">hit</span>]
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">last_hit</span> = <span class="ruby-identifier">hit</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
          <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
          <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-string">&quot;(failed %s)`%s&#39;&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">prompt_name</span>, <span class="ruby-identifier">search_word</span>]
        <span class="ruby-keyword">else</span>
          <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-string">&quot;(failed %s)`%s&#39;: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">prompt_name</span>, <span class="ruby-identifier">search_word</span>, <span class="ruby-identifier">last_hit</span>]
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inclusive-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inclusive?</span><span
                                class="method-args">(method_obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="inclusive-3F-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1415</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inclusive?</span>(<span class="ruby-identifier">method_obj</span>)
  <span class="ruby-comment"># If a motion method with the keyword argument &quot;inclusive&quot; follows the</span>
  <span class="ruby-comment"># operator, it must contain the character at the cursor position.</span>
  <span class="ruby-identifier">method_obj</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">method_obj</span>.<span class="ruby-identifier">parameters</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span> <span class="ruby-identifier">param</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:key</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">param</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:inclusive</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-incremental_search_history" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">incremental_search_history</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="incremental_search_history-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2195</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">incremental_search_history</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@history_pointer</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
      <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-identifier">whole_buffer</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-ivar">@line</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">searcher</span> = <span class="ruby-identifier">generate_searcher</span>
  <span class="ruby-identifier">searcher</span>.<span class="ruby-identifier">resume</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-string">&quot;(reverse-i-search)`&#39;: &quot;</span>
  <span class="ruby-identifier">termination_keys</span> = [<span class="ruby-string">&quot;\C-j&quot;</span>.<span class="ruby-identifier">ord</span>]
  <span class="ruby-identifier">termination_keys</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-ivar">@config</span>.<span class="ruby-identifier">isearch_terminators</span>&amp;.<span class="ruby-identifier">chars</span>&amp;.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:ord</span>)) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">isearch_terminators</span>
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-operator">-&gt;</span>(<span class="ruby-identifier">k</span>) {
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">k</span>
    <span class="ruby-keyword">when</span> <span class="ruby-operator">*</span><span class="ruby-identifier">termination_keys</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>
        <span class="ruby-identifier">buffer</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">buffer</span> = <span class="ruby-ivar">@line_backup_in_history</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
        <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
        <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-ivar">@line_index</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
        <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">last</span>
        <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">buffer</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
      <span class="ruby-ivar">@cursor</span> = <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-ivar">@cached_prompt_list</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">searcher</span>.<span class="ruby-identifier">resume</span>(<span class="ruby-value">-1</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;\C-g&quot;</span>.<span class="ruby-identifier">ord</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
        <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-ivar">@line_backup_in_history</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
        <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-ivar">@line_index</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
        <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">last</span>
        <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@line_backup_in_history</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
      <span class="ruby-ivar">@cursor</span> = <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">chr</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">chr</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">ASCII_8BIT</span>)
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">chr</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-regexp">/[[:print:]]/</span>) <span class="ruby-keyword">or</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\C-h&quot;</span>.<span class="ruby-identifier">ord</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\C-?&quot;</span>.<span class="ruby-identifier">ord</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\C-r&quot;</span>.<span class="ruby-identifier">ord</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\C-s&quot;</span>.<span class="ruby-identifier">ord</span>
        <span class="ruby-identifier">searcher</span>.<span class="ruby-identifier">resume</span>(<span class="ruby-identifier">k</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>
          <span class="ruby-identifier">line</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@line_backup_in_history</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
          <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-identifier">whole_buffer</span>
          <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
          <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
          <span class="ruby-ivar">@line_index</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
          <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">last</span>
          <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-ivar">@line</span>
          <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">line</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-ivar">@searching_prompt</span> = <span class="ruby-keyword">nil</span>
        <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
        <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
        <span class="ruby-ivar">@cursor</span> = <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
        <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
        <span class="ruby-ivar">@cached_prompt_list</span> = <span class="ruby-keyword">nil</span>
        <span class="ruby-identifier">searcher</span>.<span class="ruby-identifier">resume</span>(<span class="ruby-value">-1</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-insert_new_line" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">insert_new_line</span><span
                                class="method-args">(cursor_line, next_line)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="insert_new_line-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 332</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_new_line</span>(<span class="ruby-identifier">cursor_line</span>, <span class="ruby-identifier">next_line</span>)
  <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">cursor_line</span>
  <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">next_line</span>, <span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>))
  <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-ivar">@line_index</span>
  <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
  <span class="ruby-ivar">@just_cursor_moving</span> = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-key_delete" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">key_delete</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="key_delete-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1891</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">key_delete</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_insert</span>)
    <span class="ruby-identifier">ed_delete_next_char</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:emacs</span>)
    <span class="ruby-identifier">em_delete</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-key_newline" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">key_newline</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="key_newline-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1899</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">key_newline</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">==</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@byte_pointer</span>
      <span class="ruby-ivar">@add_newline_to_end_of_buffer</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">next_line</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-identifier">cursor_line</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-identifier">insert_new_line</span>(<span class="ruby-identifier">cursor_line</span>, <span class="ruby-identifier">next_line</span>)
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@check_new_auto_indent</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@in_pasting</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-menu" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">menu</span><span
                                class="method-args">(target, list)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="menu-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1233</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">menu</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">list</span>)
  <span class="ruby-ivar">@menu_info</span> = <span class="ruby-constant">MenuInfo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">list</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-modify_lines" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">modify_lines</span><span
                                class="method-args">(before, force_recalc: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="modify_lines-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1185</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">modify_lines</span>(<span class="ruby-identifier">before</span>, <span class="ruby-value">force_recalc:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">before</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">force_recalc</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">before</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">before</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">simplified_rendering?</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">after</span> = <span class="ruby-ivar">@output_modifier_proc</span>&amp;.<span class="ruby-identifier">call</span>(<span class="ruby-node">&quot;#{before.join(&quot;\n&quot;)}\n&quot;</span>, <span class="ruby-value">complete:</span> <span class="ruby-identifier">finished?</span>)
    <span class="ruby-identifier">after</span>.<span class="ruby-identifier">lines</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">chomp</span>(<span class="ruby-string">&#39;&#39;</span>) }
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">before</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-move_completed_list" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">move_completed_list</span><span
                                class="method-args">(list, direction)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="move_completed_list-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1327</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">move_completed_list</span>(<span class="ruby-identifier">list</span>, <span class="ruby-identifier">direction</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-ivar">@completion_state</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">NORMAL</span>, <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">COMPLETION</span>,
       <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">MENU</span>, <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">MENU_WITH_PERFECT_MATCH</span>
    <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">JOURNEY</span>
    <span class="ruby-identifier">result</span> = <span class="ruby-identifier">retrieve_completion_block</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">preposing</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">postposing</span> = <span class="ruby-identifier">result</span>
    <span class="ruby-ivar">@completion_journey_data</span> = <span class="ruby-constant">CompletionJourneyData</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-identifier">preposing</span>, <span class="ruby-identifier">postposing</span>,
      [<span class="ruby-identifier">target</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">select</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">target</span>) }, <span class="ruby-value">0</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> = <span class="ruby-value">0</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">direction</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:up</span>
        <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> = <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:down</span>
        <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> = <span class="ruby-value">1</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@completion_state</span> = <span class="ruby-constant">CompletionState</span><span class="ruby-operator">::</span><span class="ruby-constant">JOURNEY</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">direction</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:up</span>
      <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
        <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> = <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:down</span>
      <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">size</span>
        <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span> = <span class="ruby-value">0</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">completed</span> = <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">list</span>[<span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">pointer</span>]
  <span class="ruby-identifier">new_line</span> = (<span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">preposing</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">completed</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">postposing</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)[<span class="ruby-ivar">@line_index</span>]
  <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">new_line</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">new_line</span>
  <span class="ruby-identifier">line_to_pointer</span> = (<span class="ruby-ivar">@completion_journey_data</span>.<span class="ruby-identifier">preposing</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">completed</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">last</span>
  <span class="ruby-identifier">line_to_pointer</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">line_to_pointer</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line_to_pointer</span>)
  <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">line_to_pointer</span>.<span class="ruby-identifier">bytesize</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-move_cursor_down" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">move_cursor_down</span><span
                                class="method-args">(val)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="move_cursor_down-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 368</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">move_cursor_down</span>(<span class="ruby-identifier">val</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-identifier">val</span>)
    <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">val</span>
    <span class="ruby-ivar">@rest_height</span> = <span class="ruby-value">0</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-operator">-</span><span class="ruby-identifier">val</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-move_cursor_up" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">move_cursor_up</span><span
                                class="method-args">(val)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="move_cursor_up-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 359</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">move_cursor_up</span>(<span class="ruby-identifier">val</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">val</span>)
    <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">val</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-operator">-</span><span class="ruby-identifier">val</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normal_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normal_char</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normal_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1498</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normal_char</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">method_symbol</span> = <span class="ruby-identifier">method_obj</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">combined_char</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
    <span class="ruby-identifier">process_key</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">combined_char</span>, <span class="ruby-identifier">key</span>.<span class="ruby-identifier">combined_char</span>)
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@multibyte_buffer</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">combined_char</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@multibyte_buffer</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@multibyte_buffer</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-ivar">@encoding</span>).<span class="ruby-identifier">valid_encoding?</span>
      <span class="ruby-identifier">process_key</span>(<span class="ruby-ivar">@multibyte_buffer</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-ivar">@encoding</span>), <span class="ruby-keyword">nil</span>)
      <span class="ruby-ivar">@multibyte_buffer</span>.<span class="ruby-identifier">clear</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-comment"># invalid</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span> <span class="ruby-comment"># single byte</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">128</span> <span class="ruby-comment"># maybe, first byte of multi byte</span>
    <span class="ruby-identifier">method_symbol</span> = <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span>.<span class="ruby-identifier">get_method</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">combined_char</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">with_meta</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">method_symbol</span> <span class="ruby-operator">==</span> <span class="ruby-value">:ed_unassigned</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>, <span class="ruby-value">:vi_insert</span>)
        <span class="ruby-comment"># split ESC + key in vi mode</span>
        <span class="ruby-identifier">method_symbol</span> = <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span>.<span class="ruby-identifier">get_method</span>(<span class="ruby-string">&quot;\e&quot;</span>.<span class="ruby-identifier">ord</span>)
        <span class="ruby-identifier">process_key</span>(<span class="ruby-string">&quot;\e&quot;</span>.<span class="ruby-identifier">ord</span>, <span class="ruby-identifier">method_symbol</span>)
        <span class="ruby-identifier">method_symbol</span> = <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span>.<span class="ruby-identifier">get_method</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span>)
        <span class="ruby-identifier">process_key</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">char</span>, <span class="ruby-identifier">method_symbol</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">process_key</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">combined_char</span>, <span class="ruby-identifier">method_symbol</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@multibyte_buffer</span>.<span class="ruby-identifier">clear</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>) <span class="ruby-keyword">and</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@cursor_max</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-identifier">mbchar</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-padding_space_with_escape_sequences" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">padding_space_with_escape_sequences</span><span
                                class="method-args">(str, width)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="padding_space_with_escape_sequences-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 658</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">padding_space_with_escape_sequences</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">width</span>)
  <span class="ruby-identifier">padding_width</span> = <span class="ruby-identifier">width</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">str</span>, <span class="ruby-keyword">true</span>)
  <span class="ruby-comment"># padding_width should be only positive value. But macOS and Alacritty returns negative value.</span>
  <span class="ruby-identifier">padding_width</span> = <span class="ruby-value">0</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">padding_width</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
  <span class="ruby-identifier">str</span> <span class="ruby-operator">+</span> (<span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">padding_width</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_auto_indent" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_auto_indent</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_auto_indent-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1643</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_auto_indent</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@check_new_auto_indent</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@previous_line_index</span> <span class="ruby-comment"># move cursor up or down</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@check_new_auto_indent</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@previous_line_index</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@previous_line_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@previous_line_index</span>
    <span class="ruby-comment"># Fix indent of a line when a newline is inserted to the next</span>
    <span class="ruby-identifier">new_lines</span> = <span class="ruby-identifier">whole_lines</span>
    <span class="ruby-identifier">new_indent</span> = <span class="ruby-ivar">@auto_indent_proc</span>.(<span class="ruby-identifier">new_lines</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-3</span>].<span class="ruby-identifier">push</span>(<span class="ruby-string">&#39;&#39;</span>), <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, <span class="ruby-value">0</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-identifier">md</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/\A */</span>)
    <span class="ruby-identifier">prev_indent</span> = <span class="ruby-identifier">md</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">count</span>(<span class="ruby-string">&#39; &#39;</span>)
    <span class="ruby-ivar">@line</span> = <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">new_indent</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">lstrip</span>

    <span class="ruby-identifier">new_indent</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@auto_indent_proc</span>.(<span class="ruby-identifier">new_lines</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>], <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, (<span class="ruby-identifier">new_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>), <span class="ruby-keyword">false</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>
      <span class="ruby-identifier">new_indent</span> = <span class="ruby-identifier">result</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_indent</span>&amp;.<span class="ruby-identifier">&gt;=</span> <span class="ruby-value">0</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">new_indent</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">lstrip</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">new_lines</span> = <span class="ruby-identifier">whole_lines</span>
  <span class="ruby-identifier">new_indent</span> = <span class="ruby-ivar">@auto_indent_proc</span>.(<span class="ruby-identifier">new_lines</span>, <span class="ruby-ivar">@line_index</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@check_new_auto_indent</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_indent</span>&amp;.<span class="ruby-identifier">&gt;=</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">md</span> = <span class="ruby-identifier">new_lines</span>[<span class="ruby-ivar">@line_index</span>].<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/\A */</span>)
    <span class="ruby-identifier">prev_indent</span> = <span class="ruby-identifier">md</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">count</span>(<span class="ruby-string">&#39; &#39;</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@check_new_auto_indent</span>
      <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>] = <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">new_indent</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>].<span class="ruby-identifier">lstrip</span>
      <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">new_indent</span>
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line</span>)
      <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">new_indent</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">new_indent</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">lstrip</span>
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">new_indent</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">prev_indent</span>
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
      <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">new_indent</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">prev_indent</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@check_new_auto_indent</span> = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_insert" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_insert</span><span
                                class="method-args">(force: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_insert-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1916</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_insert</span>(<span class="ruby-value">force:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@continuous_insertion_buffer</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">or</span> (<span class="ruby-ivar">@in_pasting</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">force</span>)
  <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@continuous_insertion_buffer</span>)
  <span class="ruby-identifier">bytesize</span> = <span class="ruby-ivar">@continuous_insertion_buffer</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@cursor_max</span>
    <span class="ruby-ivar">@line</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@continuous_insertion_buffer</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">byteinsert</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@continuous_insertion_buffer</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">bytesize</span>
  <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-ivar">@continuous_insertion_buffer</span>.<span class="ruby-identifier">clear</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_key" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_key</span><span
                                class="method-args">(key, method_symbol)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_key-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1441</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_key</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">method_symbol</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">method_symbol</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_symbol</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-identifier">method_obj</span> = <span class="ruby-identifier">method</span>(<span class="ruby-identifier">method_symbol</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">method_obj</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">method_symbol</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_arg</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">argumentable?</span>(<span class="ruby-identifier">method_obj</span>)
      <span class="ruby-identifier">run_for_operators</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">method_symbol</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">with_operator</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">wrap_method_call</span>(<span class="ruby-identifier">method_symbol</span>, <span class="ruby-identifier">method_obj</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">with_operator</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">wrap_method_call</span>(<span class="ruby-identifier">method_symbol</span>, <span class="ruby-identifier">method_obj</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">method_obj</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">process</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_arg</span>
      <span class="ruby-ivar">@rerender_al</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-ivar">@vi_arg</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@vi_arg</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">chr</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/[0-9]/</span>
      <span class="ruby-identifier">ed_argument_digit</span>(<span class="ruby-identifier">key</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">argumentable?</span>(<span class="ruby-identifier">method_obj</span>)
        <span class="ruby-identifier">run_for_operators</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">method_symbol</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">with_operator</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">wrap_method_call</span>(<span class="ruby-identifier">method_symbol</span>, <span class="ruby-identifier">method_obj</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">with_operator</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@waiting_proc</span>
        <span class="ruby-ivar">@waiting_proc</span>.(<span class="ruby-identifier">key</span>)
      <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">method_obj</span>
        <span class="ruby-identifier">wrap_method_call</span>(<span class="ruby-identifier">method_symbol</span>, <span class="ruby-identifier">method_obj</span>, <span class="ruby-identifier">key</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">ed_insert</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">process</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_arg</span>
        <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
        <span class="ruby-ivar">@vi_arg</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@waiting_proc</span>
    <span class="ruby-ivar">@waiting_proc</span>.(<span class="ruby-identifier">key</span>)
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">process</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">method_obj</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">method_symbol</span> <span class="ruby-operator">==</span> <span class="ruby-value">:ed_argument_digit</span>
      <span class="ruby-identifier">wrap_method_call</span>(<span class="ruby-identifier">method_symbol</span>, <span class="ruby-identifier">method_obj</span>, <span class="ruby-identifier">key</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">run_for_operators</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">method_symbol</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">with_operator</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">wrap_method_call</span>(<span class="ruby-identifier">method_symbol</span>, <span class="ruby-identifier">method_obj</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">with_operator</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">process</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">ed_insert</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode_is?</span>(<span class="ruby-value">:vi_command</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-range_subtract" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">range_subtract</span><span
                                class="method-args">(base_ranges, subtract_ranges)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="range_subtract-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 665</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">range_subtract</span>(<span class="ruby-identifier">base_ranges</span>, <span class="ruby-identifier">subtract_ranges</span>)
  <span class="ruby-identifier">indices</span> = <span class="ruby-identifier">base_ranges</span>.<span class="ruby-identifier">flat_map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:to_a</span>).<span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">sort</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">subtract_ranges</span>.<span class="ruby-identifier">flat_map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:to_a</span>)
  <span class="ruby-identifier">chunks</span> = <span class="ruby-identifier">indices</span>.<span class="ruby-identifier">chunk_while</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">b</span> }
  <span class="ruby-identifier">chunks</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">first</span><span class="ruby-operator">...</span><span class="ruby-identifier">a</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-render_dialog" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">render_dialog</span><span
                                class="method-args">(cursor_column)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="render_dialog-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 649</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">render_dialog</span>(<span class="ruby-identifier">cursor_column</span>)
  <span class="ruby-identifier">changes</span> = <span class="ruby-ivar">@dialogs</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dialog</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">old_dialog</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">dup</span>
    <span class="ruby-identifier">update_each_dialog</span>(<span class="ruby-identifier">dialog</span>, <span class="ruby-identifier">cursor_column</span>)
    [<span class="ruby-identifier">old_dialog</span>, <span class="ruby-identifier">dialog</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">render_dialog_changes</span>(<span class="ruby-identifier">changes</span>, <span class="ruby-identifier">cursor_column</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-render_dialog_changes" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">render_dialog_changes</span><span
                                class="method-args">(changes, cursor_column)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="render_dialog_changes-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 677</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">render_dialog_changes</span>(<span class="ruby-identifier">changes</span>, <span class="ruby-identifier">cursor_column</span>)
  <span class="ruby-comment"># Collect x-coordinate range and content of previous and current dialogs for each line</span>
  <span class="ruby-identifier">old_dialog_ranges</span> = {}
  <span class="ruby-identifier">new_dialog_ranges</span> = {}
  <span class="ruby-identifier">new_dialog_contents</span> = {}
  <span class="ruby-identifier">changes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">old_dialog</span>, <span class="ruby-identifier">new_dialog</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">old_dialog</span>.<span class="ruby-identifier">contents</span>
      <span class="ruby-identifier">x_range</span>, <span class="ruby-identifier">y_range</span> = <span class="ruby-identifier">dialog_range</span>(<span class="ruby-identifier">old_dialog</span>, <span class="ruby-ivar">@previous_rendered_dialog_y</span>)
      <span class="ruby-identifier">y_range</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">y</span><span class="ruby-operator">|</span>
        (<span class="ruby-identifier">old_dialog_ranges</span>[<span class="ruby-identifier">y</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">x_range</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_dialog</span>.<span class="ruby-identifier">contents</span>
      <span class="ruby-identifier">x_range</span>, <span class="ruby-identifier">y_range</span> = <span class="ruby-identifier">dialog_range</span>(<span class="ruby-identifier">new_dialog</span>, <span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span>)
      <span class="ruby-identifier">y_range</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">y</span><span class="ruby-operator">|</span>
        (<span class="ruby-identifier">new_dialog_ranges</span>[<span class="ruby-identifier">y</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">x_range</span>
        (<span class="ruby-identifier">new_dialog_contents</span>[<span class="ruby-identifier">y</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">x_range</span>, <span class="ruby-identifier">new_dialog</span>.<span class="ruby-identifier">contents</span>[<span class="ruby-identifier">y</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">y_range</span>.<span class="ruby-identifier">begin</span>]]
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">old_dialog_ranges</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">new_dialog_ranges</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-comment"># Calculate x-coordinate ranges to restore text that was hidden behind dialogs for each line</span>
  <span class="ruby-identifier">ranges_to_restore</span> = {}
  <span class="ruby-identifier">subtract_cache</span> = {}
  <span class="ruby-identifier">old_dialog_ranges</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">y</span>, <span class="ruby-identifier">old_x_ranges</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">new_x_ranges</span> = <span class="ruby-identifier">new_dialog_ranges</span>[<span class="ruby-identifier">y</span>] <span class="ruby-operator">||</span> []
    <span class="ruby-identifier">ranges</span> = <span class="ruby-identifier">subtract_cache</span>[[<span class="ruby-identifier">old_x_ranges</span>, <span class="ruby-identifier">new_x_ranges</span>]] <span class="ruby-operator">||=</span> <span class="ruby-identifier">range_subtract</span>(<span class="ruby-identifier">old_x_ranges</span>, <span class="ruby-identifier">new_x_ranges</span>)
    <span class="ruby-identifier">ranges_to_restore</span>[<span class="ruby-identifier">y</span>] = <span class="ruby-identifier">ranges</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ranges</span>.<span class="ruby-identifier">any?</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># Create visual_lines for restoring text hidden behind dialogs</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">ranges_to_restore</span>.<span class="ruby-identifier">any?</span>
    <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">whole_lines</span>
    <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">_prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-value">force_recalc:</span> <span class="ruby-keyword">true</span>)
    <span class="ruby-identifier">modified_lines</span> = <span class="ruby-identifier">modify_lines</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-value">force_recalc:</span> <span class="ruby-keyword">true</span>)
    <span class="ruby-identifier">visual_lines</span> = []
    <span class="ruby-identifier">modified_lines</span>.<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">pr</span> = <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">prompt_list</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">prompt</span>
      <span class="ruby-identifier">vl</span>, = <span class="ruby-identifier">split_by_width</span>(<span class="ruby-identifier">pr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">l</span>, <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
      <span class="ruby-identifier">vl</span>.<span class="ruby-identifier">compact!</span>
      <span class="ruby-identifier">visual_lines</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">vl</span>)
    }
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># Clear and rerender all dialogs line by line</span>
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">hide_cursor</span>
  <span class="ruby-identifier">ymin</span>, <span class="ruby-identifier">ymax</span> = (<span class="ruby-identifier">ranges_to_restore</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">new_dialog_ranges</span>.<span class="ruby-identifier">keys</span>).<span class="ruby-identifier">minmax</span>
  <span class="ruby-identifier">scroll_partial_screen</span> = <span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
  <span class="ruby-identifier">screen_y_range</span> = <span class="ruby-identifier">scroll_partial_screen</span><span class="ruby-operator">..</span>(<span class="ruby-identifier">scroll_partial_screen</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
  <span class="ruby-identifier">ymin</span> = <span class="ruby-identifier">ymin</span>.<span class="ruby-identifier">clamp</span>(<span class="ruby-identifier">screen_y_range</span>.<span class="ruby-identifier">begin</span>, <span class="ruby-identifier">screen_y_range</span>.<span class="ruby-identifier">end</span>)
  <span class="ruby-identifier">ymax</span> = <span class="ruby-identifier">ymax</span>.<span class="ruby-identifier">clamp</span>(<span class="ruby-identifier">screen_y_range</span>.<span class="ruby-identifier">begin</span>, <span class="ruby-identifier">screen_y_range</span>.<span class="ruby-identifier">end</span>)
  <span class="ruby-identifier">dialog_y</span> = <span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span>
  <span class="ruby-identifier">cursor_y</span> = <span class="ruby-identifier">dialog_y</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">ymax</span>
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-identifier">ymax</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cursor_y</span>)
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">ymax</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cursor_y</span>)
  <span class="ruby-keyword">end</span>
  (<span class="ruby-identifier">ymin</span><span class="ruby-operator">..</span><span class="ruby-identifier">ymax</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">y</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-identifier">y</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cursor_y</span>)
    <span class="ruby-identifier">cursor_y</span> = <span class="ruby-identifier">y</span>
    <span class="ruby-identifier">new_x_ranges</span> = <span class="ruby-identifier">new_dialog_ranges</span>[<span class="ruby-identifier">y</span>]
    <span class="ruby-identifier">restore_ranges</span> = <span class="ruby-identifier">ranges_to_restore</span>[<span class="ruby-identifier">y</span>]
    <span class="ruby-comment"># Restore text that was hidden behind dialogs</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">restore_ranges</span>
      <span class="ruby-identifier">line</span> = <span class="ruby-identifier">visual_lines</span>[<span class="ruby-identifier">y</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&#39;&#39;</span>
      <span class="ruby-identifier">restore_ranges</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">range</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">col</span> = <span class="ruby-identifier">range</span>.<span class="ruby-identifier">begin</span>
        <span class="ruby-identifier">width</span> = <span class="ruby-identifier">range</span>.<span class="ruby-identifier">end</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">begin</span>
        <span class="ruby-identifier">s</span> = <span class="ruby-identifier">padding_space_with_escape_sequences</span>(<span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">take_range</span>(<span class="ruby-identifier">line</span>, <span class="ruby-identifier">col</span>, <span class="ruby-identifier">width</span>), <span class="ruby-identifier">width</span>)
        <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-identifier">col</span>)
        <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">&quot;\e[0m#{s}\e[0m&quot;</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">max_column</span> = [<span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line</span>, <span class="ruby-keyword">true</span>), <span class="ruby-identifier">new_x_ranges</span>&amp;.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:end</span>)&amp;.<span class="ruby-identifier">max</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>].<span class="ruby-identifier">max</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">max_column</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">restore_ranges</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:end</span>).<span class="ruby-identifier">max</span>
        <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-identifier">max_column</span>)
        <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-comment"># Render dialog contents</span>
    <span class="ruby-identifier">new_dialog_contents</span>[<span class="ruby-identifier">y</span>]&amp;.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x_range</span>, <span class="ruby-identifier">content</span><span class="ruby-operator">|</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-identifier">x_range</span>.<span class="ruby-identifier">begin</span>)
      <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">&quot;\e[0m#{content}\e[0m&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">cursor_y</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">dialog_y</span>)
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-identifier">cursor_column</span>)
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">show_cursor</span>

  <span class="ruby-ivar">@previous_rendered_dialog_y</span> = <span class="ruby-identifier">dialog_y</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-render_partial" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">render_partial</span><span
                                class="method-args">(prompt, prompt_width, line_to_render, this_started_from, with_control: true)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="render_partial-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1088</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">render_partial</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">line_to_render</span>, <span class="ruby-identifier">this_started_from</span>, <span class="ruby-value">with_control:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-identifier">visual_lines</span>, <span class="ruby-identifier">height</span> = <span class="ruby-identifier">split_by_width</span>(<span class="ruby-identifier">line_to_render</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">prompt</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">prompt</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">line_to_render</span>, <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
  <span class="ruby-identifier">cursor_up_from_last_line</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span>
    <span class="ruby-identifier">last_visual_line</span> = <span class="ruby-identifier">this_started_from</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-identifier">last_screen_line</span> = <span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">+</span> (<span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">this_started_from</span>) <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">height</span>
      <span class="ruby-comment"># Render nothing because this line is before the screen.</span>
      <span class="ruby-identifier">visual_lines</span> = []
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">this_started_from</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">last_screen_line</span>
      <span class="ruby-comment"># Render nothing because this line is after the screen.</span>
      <span class="ruby-identifier">visual_lines</span> = []
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">deleted_lines_before_screen</span> = []
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">this_started_from</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">last_visual_line</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@scroll_partial_screen</span>
        <span class="ruby-comment"># A part of visual lines are before the screen.</span>
        <span class="ruby-identifier">deleted_lines_before_screen</span> = <span class="ruby-identifier">visual_lines</span>.<span class="ruby-identifier">shift</span>((<span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">this_started_from</span>) <span class="ruby-operator">*</span> <span class="ruby-value">2</span>)
        <span class="ruby-identifier">deleted_lines_before_screen</span>.<span class="ruby-identifier">compact!</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">this_started_from</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">last_screen_line</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">last_screen_line</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">last_visual_line</span>
        <span class="ruby-comment"># A part of visual lines are after the screen.</span>
        <span class="ruby-identifier">visual_lines</span>.<span class="ruby-identifier">pop</span>((<span class="ruby-identifier">last_visual_line</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">last_screen_line</span>) <span class="ruby-operator">*</span> <span class="ruby-value">2</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">deleted_lines_before_screen</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@started_from</span>)
      <span class="ruby-identifier">cursor_up_from_last_line</span> = <span class="ruby-ivar">@started_from</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">deleted_lines_before_screen</span>.<span class="ruby-identifier">size</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">with_control</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">height</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@highest_in_this</span>
      <span class="ruby-identifier">diff</span> = <span class="ruby-identifier">height</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@highest_in_this</span>
      <span class="ruby-identifier">scroll_down</span>(<span class="ruby-identifier">diff</span>)
      <span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">diff</span>
      <span class="ruby-ivar">@highest_in_this</span> = <span class="ruby-identifier">height</span>
      <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">diff</span>)
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">height</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@highest_in_this</span>
      <span class="ruby-identifier">diff</span> = <span class="ruby-ivar">@highest_in_this</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">height</span>
      <span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">diff</span>
      <span class="ruby-ivar">@highest_in_this</span> = <span class="ruby-identifier">height</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@started_from</span>)
    <span class="ruby-ivar">@started_from</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
    <span class="ruby-identifier">cursor_up_from_last_line</span> = <span class="ruby-identifier">height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@started_from</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span><span class="ruby-operator">::</span><span class="ruby-constant">CSI_REGEXP</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">prompt</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">line_to_render</span>)
    <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">write</span> <span class="ruby-string">&quot;\e[0m&quot;</span> <span class="ruby-comment"># clear character decorations</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">visual_lines</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">visual_lines</span>[<span class="ruby-identifier">index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>], <span class="ruby-keyword">true</span>) <span class="ruby-operator">==</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">get_screen_size</span>.<span class="ruby-identifier">last</span>
        <span class="ruby-comment"># reaches the end of line</span>
        <span class="ruby-keyword">if</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">win?</span> <span class="ruby-keyword">and</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">win_legacy_console?</span>
          <span class="ruby-comment"># A newline is automatically inserted if a character is rendered at</span>
          <span class="ruby-comment"># eol on command prompt.</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-comment"># When the cursor is at the end of the line and erases characters</span>
          <span class="ruby-comment"># after the cursor, some terminals delete the character at the</span>
          <span class="ruby-comment"># cursor position.</span>
          <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-value">1</span>)
          <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
        <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-value">1</span>)
        <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">line</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">win?</span> <span class="ruby-keyword">and</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">win_legacy_console?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line</span>, <span class="ruby-keyword">true</span>) <span class="ruby-operator">==</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">get_screen_size</span>.<span class="ruby-identifier">last</span>
      <span class="ruby-comment"># A newline is automatically inserted if a character is rendered at eol on command prompt.</span>
      <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">flush</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@first_prompt</span>
      <span class="ruby-ivar">@first_prompt</span> = <span class="ruby-keyword">false</span>
      <span class="ruby-ivar">@pre_input_hook</span>&amp;.<span class="ruby-identifier">call</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">visual_lines</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">with_control</span>
    <span class="ruby-comment"># Just after rendring, so the cursor is on the last line.</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">finished?</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-comment"># Moves up from bottom of lines to the cursor position.</span>
      <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">cursor_up_from_last_line</span>)
      <span class="ruby-comment"># This logic is buggy if a fullwidth char is wrapped because there is only one halfwidth at end of a line.</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>((<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">%</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">height</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-render_whole_lines" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">render_whole_lines</span><span
                                class="method-args">(lines, prompt, prompt_width)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="render_whole_lines-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1062</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">render_whole_lines</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>)
  <span class="ruby-identifier">rendered_height</span> = <span class="ruby-value">0</span>
  <span class="ruby-identifier">modify_lines</span>(<span class="ruby-identifier">lines</span>).<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">prompt</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
      <span class="ruby-identifier">line_prompt</span> = <span class="ruby-identifier">prompt</span>[<span class="ruby-identifier">index</span>]
      <span class="ruby-identifier">prompt_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line_prompt</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">line_prompt</span> = <span class="ruby-identifier">prompt</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">height</span> = <span class="ruby-identifier">render_partial</span>(<span class="ruby-identifier">line_prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">line</span>, <span class="ruby-identifier">rendered_height</span>, <span class="ruby-value">with_control:</span> <span class="ruby-keyword">false</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">index</span> <span class="ruby-operator">&lt;</span> (<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span>
        <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">height</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">rendered_height</span> <span class="ruby-keyword">and</span> (<span class="ruby-ivar">@scroll_partial_screen</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&gt;=</span> (<span class="ruby-identifier">rendered_height</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">height</span>)
          <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-value">1</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">scroll_down</span>(<span class="ruby-value">1</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">rendered_height</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">height</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">rendered_height</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">rendered_height</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-rerender_added_newline" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rerender_added_newline</span><span
                                class="method-args">(prompt, prompt_width, prompt_list)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rerender_added_newline-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 911</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rerender_added_newline</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span>)
  <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@previous_line_index</span>] = <span class="ruby-ivar">@line</span>
  <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
  <span class="ruby-ivar">@previous_line_index</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@in_pasting</span>
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-value">1</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">whole_lines</span>
    <span class="ruby-identifier">prev_line_prompt</span> = <span class="ruby-ivar">@prompt_proc</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">prompt_list</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">prompt</span>
    <span class="ruby-identifier">prev_line_prompt_width</span> = <span class="ruby-ivar">@prompt_proc</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prev_line_prompt</span>, <span class="ruby-keyword">true</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">prompt_width</span>
    <span class="ruby-identifier">prev_line</span> = <span class="ruby-identifier">modify_lines</span>(<span class="ruby-identifier">lines</span>)[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@started_from</span>)
    <span class="ruby-identifier">render_partial</span>(<span class="ruby-identifier">prev_line_prompt</span>, <span class="ruby-identifier">prev_line_prompt_width</span>, <span class="ruby-identifier">prev_line</span>, <span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span>, <span class="ruby-value">with_control:</span> <span class="ruby-keyword">false</span>)
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-value">1</span>)
    <span class="ruby-identifier">render_partial</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-value">with_control:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@cursor</span> = <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
  <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@highest_in_this</span>
  <span class="ruby-ivar">@highest_in_this</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor_max</span>)
  <span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@started_from</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
  <span class="ruby-ivar">@started_from</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-rerender_all_lines" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rerender_all_lines</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rerender_all_lines-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1007</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rerender_all_lines</span>
  <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span>)
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
  <span class="ruby-identifier">back</span> = <span class="ruby-value">0</span>
  <span class="ruby-identifier">new_buffer</span> = <span class="ruby-identifier">whole_lines</span>
  <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-identifier">new_buffer</span>)
  <span class="ruby-identifier">new_buffer</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">prompt_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt_list</span>[<span class="ruby-identifier">index</span>], <span class="ruby-keyword">true</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@prompt_proc</span>
    <span class="ruby-identifier">width</span> = <span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">line</span>)
    <span class="ruby-identifier">height</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">width</span>)
    <span class="ruby-identifier">back</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">height</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">old_highest_in_all</span> = <span class="ruby-ivar">@highest_in_all</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line_index</span>.<span class="ruby-identifier">zero?</span>
    <span class="ruby-identifier">new_first_line_started_from</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">new_first_line_started_from</span> = <span class="ruby-identifier">calculate_height_by_lines</span>(<span class="ruby-identifier">new_buffer</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)], <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prompt</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">new_started_from</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">calculate_scroll_partial_screen</span>(<span class="ruby-identifier">back</span>, <span class="ruby-identifier">new_first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">new_started_from</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span>
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span>)
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@screen_height</span>)
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">back</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">old_highest_in_all</span>
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-identifier">back</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">back</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">back</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">old_highest_in_all</span>
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-identifier">back</span>)
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
    (<span class="ruby-identifier">old_highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">back</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span>
      <span class="ruby-identifier">scroll_down</span>(<span class="ruby-value">1</span>)
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">old_highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">render_whole_lines</span>(<span class="ruby-identifier">new_buffer</span>, <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@prompt_proc</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">prompt_list</span>[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-identifier">prompt_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@highest_in_this</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor_max</span>)
  <span class="ruby-ivar">@highest_in_all</span> = <span class="ruby-identifier">back</span>
  <span class="ruby-ivar">@first_line_started_from</span> = <span class="ruby-identifier">new_first_line_started_from</span>
  <span class="ruby-ivar">@started_from</span> = <span class="ruby-identifier">new_started_from</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scroll_partial_screen</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@screen_height</span> <span class="ruby-operator">-</span> (<span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@scroll_partial_screen</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>((<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">%</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">back</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>((<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">%</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-rerender_changed_current_line" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rerender_changed_current_line</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rerender_changed_current_line-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 963</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rerender_changed_current_line</span>
  <span class="ruby-identifier">new_lines</span> = <span class="ruby-identifier">whole_lines</span>
  <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>, <span class="ruby-identifier">prompt_list</span> = <span class="ruby-identifier">check_multiline_prompt</span>(<span class="ruby-identifier">new_lines</span>)
  <span class="ruby-identifier">all_height</span> = <span class="ruby-identifier">calculate_height_by_lines</span>(<span class="ruby-identifier">new_lines</span>, <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prompt</span>)
  <span class="ruby-identifier">diff</span> = <span class="ruby-identifier">all_height</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@highest_in_all</span>
  <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@started_from</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">diff</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-identifier">diff</span>)
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">all_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">diff</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    (<span class="ruby-operator">-</span><span class="ruby-identifier">diff</span>).<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span>
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
      <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">erase_after_cursor</span>
      <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-value">1</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">all_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">all_height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@highest_in_all</span> = <span class="ruby-identifier">all_height</span>
  <span class="ruby-identifier">back</span> = <span class="ruby-identifier">render_whole_lines</span>(<span class="ruby-identifier">new_lines</span>, <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prompt</span>, <span class="ruby-identifier">prompt_width</span>)
  <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-identifier">back</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@previous_line_index</span>
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@previous_line_index</span>] = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@first_line_started_from</span> =
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line_index</span>.<span class="ruby-identifier">zero?</span>
      <span class="ruby-value">0</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">calculate_height_by_lines</span>(<span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)], <span class="ruby-identifier">prompt_list</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prompt</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@prompt_proc</span>
    <span class="ruby-identifier">prompt</span> = <span class="ruby-identifier">prompt_list</span>[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-identifier">prompt_width</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">prompt</span>, <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@first_line_started_from</span>)
  <span class="ruby-identifier">calculate_nearest_cursor</span>
  <span class="ruby-ivar">@started_from</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@started_from</span>)
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>((<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor</span>) <span class="ruby-operator">%</span> <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
  <span class="ruby-ivar">@highest_in_this</span> = <span class="ruby-identifier">calculate_height_by_width</span>(<span class="ruby-identifier">prompt_width</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cursor_max</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-run_for_operators" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">run_for_operators</span><span
                                class="method-args">(key, method_symbol, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="run_for_operators-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1373</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">run_for_operators</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">method_symbol</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@waiting_operator_proc</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">VI_MOTIONS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">method_symbol</span>)
      <span class="ruby-identifier">old_cursor</span>, <span class="ruby-identifier">old_byte_pointer</span> = <span class="ruby-ivar">@cursor</span>, <span class="ruby-ivar">@byte_pointer</span>
      <span class="ruby-ivar">@vi_arg</span> = <span class="ruby-ivar">@waiting_operator_vi_arg</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@waiting_operator_vi_arg</span>&amp;.<span class="ruby-identifier">&gt;</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">block</span>.(<span class="ruby-keyword">true</span>)
      <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@waiting_proc</span>
        <span class="ruby-identifier">cursor_diff</span>, <span class="ruby-identifier">byte_pointer_diff</span> = <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">old_cursor</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">old_byte_pointer</span>
        <span class="ruby-ivar">@cursor</span>, <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">old_cursor</span>, <span class="ruby-identifier">old_byte_pointer</span>
        <span class="ruby-ivar">@waiting_operator_proc</span>.(<span class="ruby-identifier">cursor_diff</span>, <span class="ruby-identifier">byte_pointer_diff</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">old_waiting_proc</span> = <span class="ruby-ivar">@waiting_proc</span>
        <span class="ruby-identifier">old_waiting_operator_proc</span> = <span class="ruby-ivar">@waiting_operator_proc</span>
        <span class="ruby-identifier">current_waiting_operator_proc</span> = <span class="ruby-ivar">@waiting_operator_proc</span>
        <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-identifier">proc</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">old_cursor</span>, <span class="ruby-identifier">old_byte_pointer</span> = <span class="ruby-ivar">@cursor</span>, <span class="ruby-ivar">@byte_pointer</span>
          <span class="ruby-identifier">old_waiting_proc</span>.(<span class="ruby-identifier">k</span>)
          <span class="ruby-identifier">cursor_diff</span>, <span class="ruby-identifier">byte_pointer_diff</span> = <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">old_cursor</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">old_byte_pointer</span>
          <span class="ruby-ivar">@cursor</span>, <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-identifier">old_cursor</span>, <span class="ruby-identifier">old_byte_pointer</span>
          <span class="ruby-identifier">current_waiting_operator_proc</span>.(<span class="ruby-identifier">cursor_diff</span>, <span class="ruby-identifier">byte_pointer_diff</span>)
          <span class="ruby-ivar">@waiting_operator_proc</span> = <span class="ruby-identifier">old_waiting_operator_proc</span>
        }
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-comment"># Ignores operator when not motion is given.</span>
      <span class="ruby-identifier">block</span>.(<span class="ruby-keyword">false</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@waiting_operator_proc</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-ivar">@waiting_operator_vi_arg</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_arg</span>
      <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-ivar">@vi_arg</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">block</span>.(<span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-scroll_down" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">scroll_down</span><span
                                class="method-args">(val)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="scroll_down-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 348</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">scroll_down</span>(<span class="ruby-identifier">val</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-ivar">@rest_height</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-identifier">val</span>)
    <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">val</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_down</span>(<span class="ruby-ivar">@rest_height</span>)
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">scroll_down</span>(<span class="ruby-identifier">val</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@rest_height</span>)
    <span class="ruby-ivar">@rest_height</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-search_next_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">search_next_char</span><span
                                class="method-args">(key, arg, need_prev_char: false, inclusive: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="search_next_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3171</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search_next_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-value">need_prev_char:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">String</span>)
    <span class="ruby-identifier">inputed_char</span> = <span class="ruby-identifier">key</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">inputed_char</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">chr</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">prev_total</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">total</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">found</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>).<span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mbchar</span><span class="ruby-operator">|</span>
    <span class="ruby-comment"># total has [byte_size, cursor]</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">total</span>
      <span class="ruby-comment"># skip cursor point</span>
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
      <span class="ruby-identifier">total</span> = [<span class="ruby-identifier">mbchar</span>.<span class="ruby-identifier">bytesize</span>, <span class="ruby-identifier">width</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">inputed_char</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mbchar</span>
        <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">zero?</span>
          <span class="ruby-identifier">found</span> = <span class="ruby-keyword">true</span>
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
      <span class="ruby-identifier">prev_total</span> = <span class="ruby-identifier">total</span>
      <span class="ruby-identifier">total</span> = [<span class="ruby-identifier">total</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">mbchar</span>.<span class="ruby-identifier">bytesize</span>, <span class="ruby-identifier">total</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">width</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">need_prev_char</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">found</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">total</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-identifier">total</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">need_prev_char</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">found</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">prev_total</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-identifier">prev_total</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">inclusive</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">c</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">c</span>)
      <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-search_prev_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">search_prev_char</span><span
                                class="method-args">(key, arg, need_next_char = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="search_prev_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3228</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search_prev_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">need_next_char</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">String</span>)
    <span class="ruby-identifier">inputed_char</span> = <span class="ruby-identifier">key</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">inputed_char</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">chr</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">prev_total</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">total</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">found</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-ivar">@byte_pointer</span>).<span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">reverse_each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mbchar</span><span class="ruby-operator">|</span>
    <span class="ruby-comment"># total has [byte_size, cursor]</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">total</span>
      <span class="ruby-comment"># skip cursor point</span>
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
      <span class="ruby-identifier">total</span> = [<span class="ruby-identifier">mbchar</span>.<span class="ruby-identifier">bytesize</span>, <span class="ruby-identifier">width</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">inputed_char</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mbchar</span>
        <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">zero?</span>
          <span class="ruby-identifier">found</span> = <span class="ruby-keyword">true</span>
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
      <span class="ruby-identifier">prev_total</span> = <span class="ruby-identifier">total</span>
      <span class="ruby-identifier">total</span> = [<span class="ruby-identifier">total</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">mbchar</span>.<span class="ruby-identifier">bytesize</span>, <span class="ruby-identifier">total</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">width</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">need_next_char</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">found</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">total</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-identifier">total</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">need_next_char</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">found</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">prev_total</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-identifier">prev_total</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_menu" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_menu</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_menu-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 1195</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_menu</span>
  <span class="ruby-identifier">scroll_down</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@first_line_started_from</span>)
  <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@menu_info</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">sort!</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
    <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">item</span>
    <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">flush</span>
    <span class="ruby-identifier">scroll_down</span>(<span class="ruby-value">1</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">scroll_down</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
  <span class="ruby-identifier">move_cursor_up</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@first_line_started_from</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-split_by_width" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">split_by_width</span><span
                                class="method-args">(str, max_width)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="split_by_width-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 344</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">split_by_width</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">max_width</span>)
  <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">split_by_width</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">max_width</span>, <span class="ruby-ivar">@encoding</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-update_each_dialog" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">update_each_dialog</span><span
                                class="method-args">(dialog, cursor_column)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="update_each_dialog-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 769</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">update_each_dialog</span>(<span class="ruby-identifier">dialog</span>, <span class="ruby-identifier">cursor_column</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@in_pasting</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">contents</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">trap_key</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">set_cursor_pos</span>(<span class="ruby-identifier">cursor_column</span>, <span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@started_from</span>)
  <span class="ruby-identifier">dialog_render_info</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">call</span>(<span class="ruby-ivar">@last_key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">contents</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">trap_key</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">contents</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">contents</span>
  <span class="ruby-identifier">pointer</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">pointer</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">width</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">width</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">width</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">width</span> = <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">l</span>, <span class="ruby-keyword">true</span>) }.<span class="ruby-identifier">max</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">height</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">height</span> <span class="ruby-operator">||</span> <span class="ruby-constant">DIALOG_DEFAULT_HEIGHT</span>
  <span class="ruby-identifier">height</span> = <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">height</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">height</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">pointer</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
        <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span> = <span class="ruby-value">0</span>
      <span class="ruby-keyword">elsif</span> (<span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span>) <span class="ruby-operator">&gt;=</span> (<span class="ruby-identifier">height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
        <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
      <span class="ruby-keyword">elsif</span> (<span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
        <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">pointer</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">pointer</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">pointer</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span> = <span class="ruby-value">0</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">contents</span> = <span class="ruby-identifier">contents</span>[<span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span>, <span class="ruby-identifier">height</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">scrollbar</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">height</span>
    <span class="ruby-identifier">bar_max_height</span> = <span class="ruby-identifier">height</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>
    <span class="ruby-identifier">moving_distance</span> = (<span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">height</span>) <span class="ruby-operator">*</span> <span class="ruby-value">2</span>
    <span class="ruby-identifier">position_ratio</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span>.<span class="ruby-identifier">zero?</span> <span class="ruby-operator">?</span> <span class="ruby-value">0.0</span> <span class="ruby-operator">:</span> ((<span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">scroll_top</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>).<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">moving_distance</span>)
    <span class="ruby-identifier">bar_height</span> = (<span class="ruby-identifier">bar_max_height</span> <span class="ruby-operator">*</span> ((<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>).<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> (<span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>))).<span class="ruby-identifier">floor</span>.<span class="ruby-identifier">to_i</span>
    <span class="ruby-identifier">bar_height</span> = <span class="ruby-constant">MINIMUM_SCROLLBAR_HEIGHT</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">bar_height</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">MINIMUM_SCROLLBAR_HEIGHT</span>
    <span class="ruby-identifier">scrollbar_pos</span> = ((<span class="ruby-identifier">bar_max_height</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">bar_height</span>) <span class="ruby-operator">*</span> <span class="ruby-identifier">position_ratio</span>).<span class="ruby-identifier">floor</span>.<span class="ruby-identifier">to_i</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">scrollbar_pos</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">upper_space</span> = <span class="ruby-ivar">@first_line_started_from</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@started_from</span>
  <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">column</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">pos</span>.<span class="ruby-identifier">x</span>
  <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">width</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@block_elem_width</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">scrollbar_pos</span>
  <span class="ruby-identifier">diff</span> = (<span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">column</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">width</span>) <span class="ruby-operator">-</span> (<span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">diff</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">column</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">diff</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">pos</span>.<span class="ruby-identifier">y</span>) <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">height</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">vertical_offset</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">pos</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">upper_space</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">height</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">vertical_offset</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">pos</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">height</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">vertical_offset</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">pos</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">column</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">column</span> = <span class="ruby-value">0</span>
    <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">width</span> = <span class="ruby-ivar">@screen_size</span>.<span class="ruby-identifier">last</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">contents</span> = <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">map</span>.<span class="ruby-identifier">with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">pointer</span>
      <span class="ruby-identifier">fg_color</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">pointer_fg_color</span>
      <span class="ruby-identifier">bg_color</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">pointer_bg_color</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">fg_color</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">fg_color</span>
      <span class="ruby-identifier">bg_color</span> = <span class="ruby-identifier">dialog_render_info</span>.<span class="ruby-identifier">bg_color</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">str_width</span> = <span class="ruby-identifier">dialog</span>.<span class="ruby-identifier">width</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">scrollbar_pos</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@block_elem_width</span>)
    <span class="ruby-identifier">str</span> = <span class="ruby-identifier">padding_space_with_escape_sequences</span>(<span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">take_range</span>(<span class="ruby-identifier">item</span>, <span class="ruby-value">0</span>, <span class="ruby-identifier">str_width</span>), <span class="ruby-identifier">str_width</span>)
    <span class="ruby-identifier">colored_content</span> = <span class="ruby-node">&quot;\e[#{bg_color}m\e[#{fg_color}m#{str}&quot;</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">scrollbar_pos</span>
      <span class="ruby-identifier">color_seq</span> = <span class="ruby-string">&quot;\e[37m&quot;</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">scrollbar_pos</span> <span class="ruby-operator">&lt;=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>) <span class="ruby-keyword">and</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&lt;</span> (<span class="ruby-identifier">scrollbar_pos</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bar_height</span>)
        <span class="ruby-identifier">colored_content</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">color_seq</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@full_block</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">scrollbar_pos</span> <span class="ruby-operator">&lt;=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>) <span class="ruby-keyword">and</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>) <span class="ruby-operator">&lt;</span> (<span class="ruby-identifier">scrollbar_pos</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bar_height</span>)
        <span class="ruby-identifier">colored_content</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">color_seq</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@upper_half_block</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">scrollbar_pos</span> <span class="ruby-operator">&lt;=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>) <span class="ruby-keyword">and</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>) <span class="ruby-operator">&lt;</span> (<span class="ruby-identifier">scrollbar_pos</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bar_height</span>)
        <span class="ruby-identifier">colored_content</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">color_seq</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@lower_half_block</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">colored_content</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">color_seq</span> <span class="ruby-operator">+</span> <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@block_elem_width</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">colored_content</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_add" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_add</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_add-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2814</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_add</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span> = <span class="ruby-value">:vi_insert</span>
  <span class="ruby-identifier">ed_next_char</span>(<span class="ruby-identifier">key</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_add_at_eol" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_add_at_eol</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_add_at_eol-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2928</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_add_at_eol</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">ed_move_to_end</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span> = <span class="ruby-value">:vi_insert</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_change_meta" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_change_meta</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_change_meta-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2954</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_change_meta</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-ivar">@drop_terminate_spaces</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@waiting_operator_proc</span> = <span class="ruby-identifier">proc</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">cursor_diff</span>, <span class="ruby-identifier">byte_pointer_diff</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">cut</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_pointer_diff</span>)
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
      <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">cut</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_pointer_diff</span>, <span class="ruby-operator">-</span><span class="ruby-identifier">byte_pointer_diff</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">copy_for_vi</span>(<span class="ruby-identifier">cut</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">cursor_diff</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">cursor_diff</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">cursor_diff</span>.<span class="ruby-identifier">abs</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span> = <span class="ruby-value">:vi_insert</span>
    <span class="ruby-ivar">@drop_terminate_spaces</span> = <span class="ruby-keyword">false</span>
  }
  <span class="ruby-ivar">@waiting_operator_vi_arg</span> = <span class="ruby-identifier">arg</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_command_mode" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_command_mode</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_command_mode-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2819</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_command_mode</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">ed_prev_char</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span> = <span class="ruby-value">:vi_command</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-vi_movement_mode">vi_movement_mode</a>
                            </div>

                          </div>

                  <div id="method-i-vi_delete_meta" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_delete_meta</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_delete_meta-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2972</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_delete_meta</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-ivar">@waiting_operator_proc</span> = <span class="ruby-identifier">proc</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">cursor_diff</span>, <span class="ruby-identifier">byte_pointer_diff</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">cut</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_pointer_diff</span>)
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
      <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">cut</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_pointer_diff</span>, <span class="ruby-operator">-</span><span class="ruby-identifier">byte_pointer_diff</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">copy_for_vi</span>(<span class="ruby-identifier">cut</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">cursor_diff</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">cursor_diff</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">cursor_diff</span>.<span class="ruby-identifier">abs</span>
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
  }
  <span class="ruby-ivar">@waiting_operator_vi_arg</span> = <span class="ruby-identifier">arg</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_delete_prev_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_delete_prev_char</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_delete_prev_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2903</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_delete_prev_char</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>] = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>])
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">+=</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-ivar">@line_index</span>)
    <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_prev_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">mbchar</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
    <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">mbchar</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_end_big_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_end_big_word</span><span
                                class="method-args">(key, arg: 1, inclusive: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_end_big_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2884</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_end_big_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">vi_big_forward_end_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">inclusive</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">zero?</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">c</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">c</span>)
      <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">vi_end_big_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_end_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_end_word</span><span
                                class="method-args">(key, arg: 1, inclusive: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_end_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2845</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_end_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">vi_forward_end_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">inclusive</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">zero?</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">c</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_size</span>)
      <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">c</span>)
      <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">vi_end_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_first_print" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_first_print</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_first_print-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2053</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_first_print</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@cursor</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">vi_first_print</span>(<span class="ruby-ivar">@line</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_histedit" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_histedit</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_histedit-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3057</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_histedit</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">path</span> = <span class="ruby-constant">Tempfile</span>.<span class="ruby-identifier">open</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">fp</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
      <span class="ruby-identifier">fp</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">whole_lines</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">fp</span>.<span class="ruby-identifier">write</span> <span class="ruby-ivar">@line</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">fp</span>.<span class="ruby-identifier">path</span>
  }
  <span class="ruby-identifier">system</span>(<span class="ruby-node">&quot;#{ENV[&#39;EDITOR&#39;]} #{path}&quot;</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span>
    <span class="ruby-ivar">@buffer_of_lines</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>)
    <span class="ruby-ivar">@buffer_of_lines</span> = [<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">encoding:</span> <span class="ruby-ivar">@encoding</span>)] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-ivar">@line_index</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>]
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">finish</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_insert" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_insert</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_insert-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2810</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_insert</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span> = <span class="ruby-value">:vi_insert</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_insert_at_bol" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_insert_at_bol</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_insert_at_bol-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2923</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_insert_at_bol</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">ed_move_to_beg</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">editing_mode</span> = <span class="ruby-value">:vi_insert</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_join_lines" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_join_lines</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_join_lines-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3268</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_join_lines</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span>
    <span class="ruby-ivar">@line</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-ivar">@line_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">lstrip</span>
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@buffer_of_lines</span>[<span class="ruby-ivar">@line_index</span>] = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@rerender_all</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-ivar">@rest_height</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">vi_join_lines</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_kill_line_prev" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_kill_line_prev</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <dl class="rdoc-list note-list"><dt>Editline
<dd>
<p><code>vi-kill-line-prev</code> (vi: <code>Ctrl-U</code>) Delete the string from the beginning  of the edit buffer to the cursor and save it to the cut buffer.</p>
</dd><dt>GNU Readline
<dd>
<p><code>unix-line-discard</code> (<code>C-u</code>) Kill backward from the cursor to the beginning of the current line.</p>
</dd></dl>

                              <div class="method-source-code" id="vi_kill_line_prev-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2574</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_kill_line_prev</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@line</span>, <span class="ruby-identifier">deleted</span> = <span class="ruby-identifier">byteslice!</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@kill_ring</span>.<span class="ruby-identifier">append</span>(<span class="ruby-identifier">deleted</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-unix_line_discard">unix_line_discard</a>
                            </div>

                          </div>

                  <div id="method-i-vi_list_or_eof" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_list_or_eof</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_list_or_eof-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2999</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_list_or_eof</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> (<span class="ruby-keyword">not</span> <span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">empty?</span>) <span class="ruby-keyword">or</span> (<span class="ruby-ivar">@is_multiline</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>)
    <span class="ruby-ivar">@line</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@buffer_of_lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">scroll_down</span>(<span class="ruby-ivar">@highest_in_all</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@first_line_started_from</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">IOGate</span>.<span class="ruby-identifier">move_cursor_column</span>(<span class="ruby-value">0</span>)
    <span class="ruby-ivar">@eof</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-identifier">finish</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">ed_newline</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-vi_end_of_transmission">vi_end_of_transmission</a>, <a href="LineEditor.html#method-i-vi_eof_maybe">vi_eof_maybe</a>
                            </div>

                          </div>

                  <div id="method-i-vi_next_big_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_next_big_word</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_next_big_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2864</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_next_big_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">vi_big_forward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">vi_next_big_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_next_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_next_char</span><span
                                class="method-args">(key, arg: 1, inclusive: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_next_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3163</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_next_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-operator">-&gt;</span>(<span class="ruby-identifier">key_for_proc</span>) { <span class="ruby-identifier">search_next_char</span>(<span class="ruby-identifier">key_for_proc</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-identifier">inclusive</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_next_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_next_word</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_next_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2825</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_next_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@byte_pointer</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">vi_forward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@drop_terminate_spaces</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">vi_next_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_paste_next" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_paste_next</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_paste_next-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3091</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_paste_next</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_clipboard</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">byteinsert</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_size</span>, <span class="ruby-ivar">@vi_clipboard</span>)
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@vi_clipboard</span>)
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@vi_clipboard</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@vi_clipboard</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">vi_paste_next</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_paste_prev" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_paste_prev</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_paste_prev-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3079</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_paste_prev</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@vi_clipboard</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">byteinsert</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@vi_clipboard</span>)
    <span class="ruby-ivar">@cursor_max</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@vi_clipboard</span>)
    <span class="ruby-identifier">cursor_point</span> = <span class="ruby-ivar">@vi_clipboard</span>.<span class="ruby-identifier">grapheme_clusters</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>].<span class="ruby-identifier">join</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">cursor_point</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">cursor_point</span>.<span class="ruby-identifier">bytesize</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">vi_paste_prev</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_prev_big_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_prev_big_word</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_prev_big_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2874</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_prev_big_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">vi_big_backward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">vi_prev_big_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_prev_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_prev_char</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_prev_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3220</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_prev_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-operator">-&gt;</span>(<span class="ruby-identifier">key_for_proc</span>) { <span class="ruby-identifier">search_prev_char</span>(<span class="ruby-identifier">key_for_proc</span>, <span class="ruby-identifier">arg</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_prev_word" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_prev_word</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_prev_word-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2835</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_prev_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">byte_size</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">vi_backward_word</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
    <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">byte_size</span>
    <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">width</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">vi_prev_word</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_replace_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_replace_char</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_replace_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3135</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_replace_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-operator">-&gt;</span>(<span class="ruby-identifier">k</span>) {
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">byte_size</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span>)
      <span class="ruby-identifier">before</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
      <span class="ruby-identifier">remaining_point</span> = <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_size</span>
      <span class="ruby-identifier">after</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">remaining_point</span>, <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">remaining_point</span>)
      <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">before</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">chr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">after</span>
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
      <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
      <span class="ruby-identifier">byte_size</span> = <span class="ruby-value">0</span>
      <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span>
        <span class="ruby-identifier">byte_size</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_next_mbchar_size</span>(<span class="ruby-ivar">@line</span>, <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_size</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">before</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@byte_pointer</span>)
      <span class="ruby-identifier">remaining_point</span> = <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_size</span>
      <span class="ruby-identifier">after</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-identifier">remaining_point</span>, <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">bytesize</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">remaining_point</span>)
      <span class="ruby-identifier">replaced</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">chr</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-ivar">@line</span> = <span class="ruby-identifier">before</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">replaced</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">after</span>
      <span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">replaced</span>.<span class="ruby-identifier">bytesize</span>
      <span class="ruby-ivar">@cursor</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">calculate_width</span>(<span class="ruby-identifier">replaced</span>)
      <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
      <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_search_next" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_search_next</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_search_next-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2287</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_search_next</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">incremental_search_history</span>(<span class="ruby-identifier">key</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-forward_search_history">forward_search_history</a>
                            </div>

                          </div>

                  <div id="method-i-vi_search_prev" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_search_prev</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_search_prev-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2282</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_search_prev</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">incremental_search_history</span>(<span class="ruby-identifier">key</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="LineEditor.html#method-i-reverse_search_history">reverse_search_history</a>
                            </div>

                          </div>

                  <div id="method-i-vi_to_column" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_to_column</span><span
                                class="method-args">(key, arg: 0)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_to_column-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3120</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_to_column</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">0</span>)
  <span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-ivar">@cursor</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">grapheme_clusters</span>.<span class="ruby-identifier">inject</span>([<span class="ruby-value">0</span>, <span class="ruby-value">0</span>]) { <span class="ruby-operator">|</span><span class="ruby-identifier">total</span>, <span class="ruby-identifier">gc</span><span class="ruby-operator">|</span>
    <span class="ruby-comment"># total has [byte_size, cursor]</span>
    <span class="ruby-identifier">mbchar_width</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">Unicode</span>.<span class="ruby-identifier">get_mbchar_width</span>(<span class="ruby-identifier">gc</span>)
    <span class="ruby-keyword">if</span> (<span class="ruby-identifier">total</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">mbchar_width</span>) <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-keyword">break</span> <span class="ruby-identifier">total</span>
    <span class="ruby-keyword">elsif</span> (<span class="ruby-identifier">total</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">mbchar_width</span>) <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@cursor_max</span>
      <span class="ruby-keyword">break</span> <span class="ruby-identifier">total</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">total</span> = [<span class="ruby-identifier">total</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">gc</span>.<span class="ruby-identifier">bytesize</span>, <span class="ruby-identifier">total</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">mbchar_width</span>]
      <span class="ruby-identifier">total</span>
    <span class="ruby-keyword">end</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_to_history_line" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_to_history_line</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_to_history_line-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3034</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_to_history_line</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@line_backup_in_history</span> = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@history_pointer</span>.<span class="ruby-identifier">zero?</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>] = <span class="ruby-ivar">@line</span>
    <span class="ruby-ivar">@history_pointer</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@line</span> = <span class="ruby-constant">Reline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span>[<span class="ruby-ivar">@history_pointer</span>]
    <span class="ruby-ivar">@cursor_max</span> = <span class="ruby-identifier">calculate_width</span>(<span class="ruby-ivar">@line</span>)
    <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
    <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_to_next_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_to_next_char</span><span
                                class="method-args">(key, arg: 1, inclusive: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_to_next_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3167</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_to_next_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-operator">-&gt;</span>(<span class="ruby-identifier">key_for_proc</span>) { <span class="ruby-identifier">search_next_char</span>(<span class="ruby-identifier">key_for_proc</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-value">need_prev_char:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">inclusive:</span> <span class="ruby-identifier">inclusive</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_to_prev_char" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_to_prev_char</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_to_prev_char-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 3224</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_to_prev_char</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-ivar">@waiting_proc</span> = <span class="ruby-operator">-&gt;</span>(<span class="ruby-identifier">key_for_proc</span>) { <span class="ruby-identifier">search_prev_char</span>(<span class="ruby-identifier">key_for_proc</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-keyword">true</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_yank" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_yank</span><span
                                class="method-args">(key, arg: 1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_yank-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2987</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_yank</span>(<span class="ruby-identifier">key</span>, <span class="ruby-value">arg:</span> <span class="ruby-value">1</span>)
  <span class="ruby-ivar">@waiting_operator_proc</span> = <span class="ruby-identifier">proc</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">cursor_diff</span>, <span class="ruby-identifier">byte_pointer_diff</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">cut</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span>, <span class="ruby-identifier">byte_pointer_diff</span>)
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">byte_pointer_diff</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">cut</span> = <span class="ruby-ivar">@line</span>.<span class="ruby-identifier">byteslice</span>(<span class="ruby-ivar">@byte_pointer</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">byte_pointer_diff</span>, <span class="ruby-operator">-</span><span class="ruby-identifier">byte_pointer_diff</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">copy_for_vi</span>(<span class="ruby-identifier">cut</span>)
  }
  <span class="ruby-ivar">@waiting_operator_vi_arg</span> = <span class="ruby-identifier">arg</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vi_zero" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vi_zero</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vi_zero-source">
            <pre><span class="ruby-comment"># File reline/line_editor.rb, line 2949</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vi_zero</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@byte_pointer</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@cursor</span> = <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

